Open poorna2152 opened 2 years ago
(module (type $Any (struct (field $type i32))) (type $BoxedInt (struct_subtype (field $type i32) (field $val i64) $Any)) (import "console" "log32" (func $println32 (param i32))) (export "main" (func $main)) (func $test (result (ref $BoxedInt)) (struct.new $BoxedInt (i32.const 128) (i64.const 1028))) (func $main (local $0 eqref) (local.set $0 (call $test)) (call $println32 (struct.get $Any $type (ref.cast_static $Any (ref.as_data (local.get $0)))))))
This program works when ./wasm-as is run with the --nominal flag.
./wasm-as
--nominal
New instructions used. struct.new, ref.cast, struct_subtype.
struct.new
ref.cast
struct_subtype
./wasm-as main.wat -o main.wasm --nominal -all
Will look into this once the documentation is updated
This program works when
./wasm-as
is run with the--nominal
flag.New instructions used.
struct.new
,ref.cast
,struct_subtype
.