From 63e105c869ec16645a5fe59c0f2e2983b0a50ea9 Mon Sep 17 00:00:00 2001 From: Yordis Prieto Date: Fri, 14 Aug 2026 22:25:57 -0400 Subject: [PATCH] fix(wit): allow feature gates on resource methods 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 --- design/mvp/WIT.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/design/mvp/WIT.md b/design/mvp/WIT.md index 5fe1f403..f7c58af7 100644 --- a/design/mvp/WIT.md +++ b/design/mvp/WIT.md @@ -1811,12 +1811,15 @@ desugar to an owned return value. Specifically, the syntax for a `resource` definition is: ```ebnf resource-item ::= 'resource' id ';' - | 'resource' id '{' ( external-id? resource-method )* '}' + | 'resource' id '{' ( gate external-id? resource-method )* '}' resource-method ::= func-item | id ':' 'static' func-type ';' | 'constructor' param-list ';' ``` +As with the items of a `world` or an `interface`, the methods of a `resource` +can be individually gated, as described [above](#feature-gates). + The optional `async` on `static` functions has the same meaning as in a non-`static` `func-item`.