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

primitive aliases used before definitions are not handled properly #98

Closed
rooooooooob opened this issue Sep 19, 2022 · 0 comments · Fixed by #103
Closed

primitive aliases used before definitions are not handled properly #98

rooooooooob opened this issue Sep 19, 2022 · 0 comments · Fixed by #103
Labels
bug Something isn't working

Comments

@rooooooooob
Copy link
Collaborator

example:

pool_params = ( operator:       pool_keyhash
              , vrf_keyhash:    vrf_keyhash
              , pledge:         coin
              , cost:           coin
              , margin:         unit_interval
              , reward_account: reward_account
              , pool_owners:    set<addr_keyhash>
              , relays:         [* relay]
              , pool_metadata:  pool_metadata / null
              )

coin = uint

will cause the coin: coin in pool_params to be treated as RustType::Rust(RustIdent("Coin")) instead of RustType::Alias(AliasIdent::Rust(RustIdent("Coin")), RustType::Primitive(Primitive::U64)) which results in to/from wasm generating incorrect code as it thinks it's a rust struct not a primitive. This is a problem as it will try and take it by reference (important since &u64 params are compile errors in wasm_bindgen) and will clone it excessively (less important).

This would likely be fixed by #93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant