Skip to content

Commit 9c43f51

Browse files
authored
Disallow outer aliases of core module type from inside core module types (#266)
Resolves #265
1 parent cc60a35 commit 9c43f51

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

design/mvp/Binary.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ core:exportdecl ::= n:<core:name> d:<core:importdesc> => (export n d)
168168
```
169169
Notes:
170170
* Reused Core binary rules: [`core:import`], [`core:importdesc`], [`core:functype`]
171-
* Validation of `core:moduledecl` (currently) rejects `core:moduletype` definitions
172-
inside `type` declarators (i.e., nested core module types).
171+
* Validation of `core:moduledecl` rejects `core:moduletype` definitions
172+
and `outer` aliases of `core:moduletype` definitions inside `type`
173+
declarators. Thus, as an invariant, when validating a `core:moduletype`, the
174+
core type index space will not contain any core module types.
173175
* As described in the explainer, each module type is validated with an
174176
initially-empty type index space.
175177
* `alias` declarators currently only allow `outer` `type` aliases but

design/mvp/Explainer.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,12 @@ where strip-id(X) parses '(' sort Y ')' when X parses '(' sort <id>? Y ')'
477477
```
478478

479479
Here, `core:deftype` (short for "defined type") is inherited from the [gc]
480-
proposal and extended with a `module` type constructor. If module-linking is
480+
proposal and extended with a `module` type constructor. If [module-linking] is
481481
added to Core WebAssembly, an `instance` type constructor would be added as
482482
well but, for now, it's left out since it's unnecessary. Also, in the MVP,
483-
validation will reject nested `core:moduletype`, since, before module-linking,
484-
core modules cannot themselves import or export other core modules.
483+
validation will reject `core:moduletype` defining or aliasing other
484+
`core:moduletype`s, since, before module-linking, core modules cannot
485+
themselves import or export other core modules.
485486

486487
The body of a module type contains an ordered list of "module declarators"
487488
which describe, at a type level, the imports and exports of the module. In a

0 commit comments

Comments
 (0)