Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTT pushed to PostMVP #53

Open
poorna2152 opened this issue Jun 23, 2022 · 2 comments
Open

RTT pushed to PostMVP #53

poorna2152 opened this issue Jun 23, 2022 · 2 comments
Labels
question Further information is requested

Comments

@poorna2152
Copy link
Owner

No description provided.

@poorna2152 poorna2152 added the question Further information is requested label Jun 23, 2022
@poorna2152 poorna2152 self-assigned this Jun 23, 2022
@poorna2152
Copy link
Owner Author

(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.

New instructions used. struct.new, ref.cast, struct_subtype.

./wasm-as main.wat -o main.wasm --nominal -all

@poorna2152
Copy link
Owner Author

Will look into this once the documentation is updated

@poorna2152 poorna2152 removed their assignment Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant