@@ -493,17 +493,13 @@ implicitly-created `func` type referring to both.
493
493
Lastly, the ` core:alias ` module declarator allows a module type definition to
494
494
reuse (rather than redefine) type definitions in the enclosing component's core
495
495
type index space via ` outer ` ` type ` alias. In the MVP, validation restricts
496
- ` core:alias ` module declarators to * only* allow ` outer ` ` type ` aliases but,
497
- in the future, more kinds of aliases would be meaningful and allowed.
496
+ ` core:alias ` module declarators to * only* allow ` outer ` ` type ` aliases (into an
497
+ enclosing component's or component-type's core type index space). In the
498
+ future, more kinds of aliases would be meaningful and allowed.
498
499
499
500
As an example, the following component defines two semantically-equivalent
500
501
module types, where the former defines the function type via ` type ` declarator
501
- and the latter refers via ` alias ` declarator. Note that, since core type
502
- definitions are validated in a Core WebAssembly context that doesn't "know"
503
- anything about components, the module type ` $C2 ` can't name ` $C ` directly in
504
- the text format but must instead use the appropriate [ de Bruijn] index (` 1 ` ).
505
- In both cases, the defined/aliased function type is given index ` 0 ` since
506
- module types always start with an empty type index space.
502
+ and the latter refers via ` alias ` declarator.
507
503
``` wasm
508
504
(component $C
509
505
(core type $C1 (module
@@ -513,7 +509,7 @@ module types always start with an empty type index space.
513
509
))
514
510
(core type $F (func (param i32) (result i32)))
515
511
(core type $C2 (module
516
- (alias outer 1 $F (type))
512
+ (alias outer $C $F (type))
517
513
(import "a" "b" (func (type 0)))
518
514
(export "c" (func (type 0)))
519
515
))
0 commit comments