@@ -137,8 +137,7 @@ Notes:
137
137
(See [ Type Definitions] ( Explainer.md#type-definitions ) in the explainer.)
138
138
``` ebnf
139
139
core:type ::= dt:<core:deftype> => (type dt) (GC proposal)
140
- core:deftype ::= ft:<core:functype> => ft (WebAssembly 1.0)
141
- | 0x00 rt:<core:rectype> => rt (WebAssembly 3.0)
140
+ core:deftype ::= rt:<core:rectype> => rt (WebAssembly 3.0)
142
141
| mt:<core:moduletype> => mt
143
142
core:moduletype ::= 0x50 md*:vec(<core:moduledecl>) => (module md*)
144
143
core:moduledecl ::= 0x00 i:<core:import> => i
@@ -152,14 +151,14 @@ core:exportdecl ::= n:<core:name> d:<core:importdesc> => (export n d)
152
151
```
153
152
Notes:
154
153
* Reused Core binary rules: [ ` core:import ` ] , [ ` core:importdesc ` ] ,
155
- [ ` core:functype ` ] , [ ` core: rectype` ]
156
- * The three branches of ` core:deftype ` have prefix bytes of 0x60
157
- ( ` core:functype ` ), 0x50 ( ` core:moduletype ` ), and 0x00 ( ` core:rectype ` ). This
158
- is because the component model and the GC specifications (i.e., source of
159
- ` core:rectype ` ) have evolved in parallel and independently. Ideally, in the
160
- future, the ` core:functype ` production would be removed as it can be expressed
161
- within ` core:rectype ` . Also, the prefix byte of ` core:moduletype ` (0x50) will
162
- also likely change as well .
154
+ [ ` core:rectype ` ]
155
+ * Unfortunately, the ` core:deftype ` rule results in an encoding ambiguity: the
156
+ ` 0x50 ` opcode is used by both ` core:moduletype ` and ` core:subtype ` , which can
157
+ be decoded as a top-level form of ` core:rectype ` . To resolve this, prior to
158
+ v1.0 of this specification, we require ` core:subtype ` to be prefixed by ` 0x00 `
159
+ in this context (i.e., a ` sub ` as a component core type is ` 0x00 0x50 ` ;
160
+ elsewhere, ` 0x50 ` ). By the v1.0 release of this specification,
161
+ ` core:moduletype ` will receive a new, non-overlapping opcode .
163
162
* Validation of ` core:moduledecl ` rejects ` core:moduletype ` definitions
164
163
and ` outer ` aliases of ` core:moduletype ` definitions inside ` type `
165
164
declarators. Thus, as an invariant, when validating a ` core:moduletype ` , the
0 commit comments