In the GC proposal, it allows using previous global value as an initializer expression.

![Screenshot 2024-04-02 at 7 03 26 PM](https://github.com/WebAssembly/wabt/assets/50018375/f2469889-b0e1-49a1-8f3f-0f2e52409f67)

Therefore, following wasm module is a valid module in the GC proposal.

```
;; global.wat
(module (global i32 (i32.const 0)) (global i32 (global.get 0)))
```

I run the module with the reference interpreter in the [gc proposal](https://github.com/WebAssembly/gc), and it passes the validation.

```
$ gc/interperter/wasm global.wat
// terminates normally
```

As the reference interpreter also includes function references and tail call proposals, I enable all of them and run wat2wasm, but it raises type error.

```
$ wabt/bin/wat2wasm --enable-function-references --enable-tail-call --enable-gc global.wat
global.wat:1:60: error: initializer expression can only reference an imported global
(module (global i32 (i32.const 0)) (global i32 (global.get 0)))
                                                           ^
```
Wrong type error when validating globals with gc proposal features
This is a GitHub Issue
repo:wabt
owner:WebAssembly
Title : Wrong type error when validating globals with gc proposal features
Issue date:

--- start body ---
In the GC proposal, it allows using previous global value as an initializer expression.

![Screenshot 2024-04-02 at 7 03 26 PM](https://github.com/WebAssembly/wabt/assets/50018375/f2469889-b0e1-49a1-8f3f-0f2e52409f67)

Therefore, following wasm module is a valid module in the GC proposal.

```
;; global.wat
(module (global i32 (i32.const 0)) (global i32 (global.get 0)))
```

I run the module with the reference interpreter in the [gc proposal](https://github.com/WebAssembly/gc), and it passes the validation.

```
$ gc/interperter/wasm global.wat
// terminates normally
```

As the reference interpreter also includes function references and tail call proposals, I enable all of them and run wat2wasm, but it raises type error.

```
$ wabt/bin/wat2wasm --enable-function-references --enable-tail-call --enable-gc global.wat
global.wat:1:60: error: initializer expression can only reference an imported global
(module (global i32 (i32.const 0)) (global i32 (global.get 0)))
                                                           ^
```
--- end body ---
