Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow outer aliases of core module type from inside core module types #266

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions design/mvp/Binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ core:exportdecl ::= n:<core:name> d:<core:importdesc> => (export n d)
```
Notes:
* Reused Core binary rules: [`core:import`], [`core:importdesc`], [`core:functype`]
* Validation of `core:moduledecl` (currently) rejects `core:moduletype` definitions
inside `type` declarators (i.e., nested core module types).
* Validation of `core:moduledecl` rejects `core:moduletype` definitions
and `outer` aliases of `core:moduletype` definitions inside `type`
declarators. Thus, as an invariant, when validating a `core:moduletype`, the
core type index space will not contain any core module types.
* As described in the explainer, each module type is validated with an
initially-empty type index space.
* `alias` declarators currently only allow `outer` `type` aliases but
Expand Down
7 changes: 4 additions & 3 deletions design/mvp/Explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,12 @@ where strip-id(X) parses '(' sort Y ')' when X parses '(' sort <id>? Y ')'
```

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

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