Skip to content

Commit 3ebfc04

Browse files
committed
Require transitive gating, and add examples
1 parent 86453cf commit 3ebfc04

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

design/mvp/WIT.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,28 @@ unstable-gate ::= '@unstable' '(' feature-field ')'
905905
feature-field ::= 'feature' '=' id
906906
since-gate ::= '@since' '(' 'version' '=' '"' <valid semver> '"' ( ',' feature-field )? ')'
907907
```
908+
908909
As part of WIT validation, any item that refers to another gated item must also
909-
be gated.
910+
be compatibly gated. For example, this is an error:
911+
```wit
912+
interface i {
913+
@since("1.0.1")
914+
type t1 = u32;
915+
916+
type t2 = t1; // error
917+
}
918+
```
919+
Additionally, if an item is *contained* by a gated item, it must also be
920+
compatibly gated. For example, this is an error:
921+
```wit
922+
@since("1.0.2")
923+
interface i {
924+
foo: func(); // error: no gate
925+
926+
@since("1.0.1")
927+
bar: func(); // also error: weaker gate
928+
}
929+
```
910930

911931
## Package declaration
912932

0 commit comments

Comments
 (0)