Check returns in untyped host functions #27
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Host function created with
Extern::func
could return wrong types and executor wouldn't notice. So I took a crack at fixing it. I'm a rust beginner though, so review carefullyI'm not sure about tests location - so far I've put them into "test" folder in the repo root which (if I understood "integration tests" chapter) is a standard way to test public api. Test suite doesn't have "wat" module and appears to me to be directed more at wasm side, rather than host side api.
I also added checks to that test file to ensure that host function don't link if types mismatch, because
i couldi had utility functions for trying combinations anyway, and they are thematically close (as "imported host function signature")