Allow feature gates on resource methods - #700
Open
yordis wants to merge 1 commit into
Open
Conversation
WASI 0.3 gates individual resource methods and wasm-tools accepts them, but the grammar as written does not permit it. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
resource-itemproduction does not permit agateon resource methods, but WASI 0.3 already relies on being able to gate them individually. For example,resource descriptorcarries@sinceon each of its methods, andwasm-toolsparses and round-trips that today.So this is the spec text lagging behind both the tooling and the WASI proposals rather than a feature request. The fix places
gateon the containing item list, matching howworld-items ::= gate world-definitionandinterface-items ::= gate interface-definitionalready do it.Record fields, enum cases, variant cases and flags are deliberately left alone;
wasm-toolsrejects gates on those, so the grammar is already correct there.