Skip to content

Commit 8906654

Browse files
committed
Add notes about subtyping and recursion w.r.t module types
1 parent b2d1ea8 commit 8906654

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Diff for: design/mvp/Explainer.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -452,12 +452,16 @@ core:exportdesc ::= strip-id(<core:importdesc>)
452452
where strip-id(X) parses '(' sort Y ')' when X parses '(' sort <id>? Y ')'
453453
```
454454

455-
Here, `core:comptype` (short for "composite type") as defined in the [gc]
456-
proposal is extended with a `module` type constructor. If [module-linking] is
457-
added to Core WebAssembly, an `instance` type constructor would be added as
458-
well but, for now, it's left out since it's unnecessary. Also, in the MVP,
459-
validation will reject `core:moduletype` defining or aliasing other
460-
`core:moduletype`s, since, before module-linking, core modules cannot
455+
Here, `core:comptype` (short for "composite type") as defined in the [GC]
456+
proposal is extended with a `module` type constructor. The GC proposal also
457+
adds recursion and explicit subtyping between core wasm types. Owing to
458+
their different requirements and intended modes of usage, module types
459+
support implicit subtyping and are not recursive. Thus, the existing core
460+
validation rules would require the declared supertypes of module types to be
461+
empty and disallow recursive use of module types.
462+
463+
In the MVP, validation will also reject `core:moduletype` defining or aliasing
464+
other `core:moduletype`s, since, before module-linking, core modules cannot
461465
themselves import or export other core modules.
462466

463467
The body of a module type contains an ordered list of "module declarators"

0 commit comments

Comments
 (0)