Closed danbev closed 1 year ago
Thanks for trying out the examples! I think this might be a not-yet-implemented case in wasm-tools. In particular, if you search for the phrase "aliases can be written in an inverted form that puts the sort first" in the explainer, it describes an inverted syntax that I believe makes both forms (before and after this PR) equivalent. The inverted syntax is used a lot for functions in the examples (which validate in wasm-tools atm), so maybe it's just missing for types. Is that right @alexcrichton / @peterhuene ?
That being said, having the inverted syntax work for types is not particularly important and it is quite nice to have the examples in the explainer validate in wasm-tools, so if it's not a quick fix, we can merge this PR.
Inverted alias forms do not appear to be implemented in the wast
crate used from wasm-tools
.
I think a better course of action is to open an issue in wasm-tools
to implement the inverted forms and leave the explainer examples as they are; we'll use them as test cases for the parser tests.
FYI, it appears the only currently supported inverted forms in wast
for aliases are for the sorts core func
and func
.
Thanks @peterhuene! sgtm
I think this might be a not-yet-implemented case in wasm-tools. In particular, if you search for the phrase "aliases can be written in an inverted form that puts the sort first" in the explainer, it describes an inverted syntax that I believe makes both forms (before and after this PR) equivalent.
Ah sorry about that, I did not realize this was using the inverted form.
I think a better course of action is to open an issue in wasm-tools to implement the inverted forms and leave the explainer examples as they are; we'll use them as test cases for the parser tests.
Sounds good! I'll open an issue for this :+1:
@lukewagner @peterhuene Thanks for the feedback and sorry about the noise. I'll close this pull request and open an issue in wasm-tools.
This commit updates the example given in the
Type Checking
section.The motivation for this update is that the current example does not seem to be correct:
With the updates in this commit the output will be:
I think this is correct but hopefully others can correct me if I'm wrong.