Skip to content

Commit cf8c769

Browse files
authored
Clarify validation rules for borrow (#221)
Resolves #219
1 parent e6d50af commit cf8c769

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

design/mvp/Binary.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,9 @@ Notes:
244244
* Validation of `valtype` requires the `typeidx` to refer to a `defvaltype`.
245245
* Validation of `own` and `borrow` requires the `typeidx` to refer to a
246246
resource type.
247-
* Validation only allows `borrow` to be used inside the `param` of a `functype`.
248-
(This is likely to change in a future PR, converting `functype` into a
249-
compound type constructor analogous to `moduletype` and `componenttype` and
250-
using scoping to enforce this constraint instead.)
247+
* Validation of `functype` rejects any transitive use of `borrow` in a
248+
`result` type. Similarly, validation of components and component types
249+
rejects any transitive use of `borrow` in an exported value type.
251250
* Validation of `resourcetype` requires the destructor (if present) to have
252251
type `[i32] -> []`.
253252
* Validation of `instancedecl` (currently) only allows the `type` and

0 commit comments

Comments
 (0)