You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: proposals/function-references/Overview.md
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,8 @@ Note: In a Wasm engine, function references (whether first-class or as table ent
46
46
47
47
* Add a block instruction `let (local t*) ... end` for introducing locals with block scope, in order to handle reference types without default initialisation values
48
48
49
+
* Add an optional initialiser expression to table definitions, for element types that do not have an implicit default value.
50
+
49
51
50
52
### Examples
51
53
@@ -150,13 +152,13 @@ Greatest fixpoint (co-inductive interpretation) of the given rules (implying ref
150
152
151
153
The following rules, now defined in terms of constructed types, replace and extend the rules for [basic reference types](https://github.com/WebAssembly/reference-types/proposals/reference-types/Overview.md#subtyping).
152
154
153
-
#### Value Types
155
+
#####Value Types
154
156
155
157
* Reference types are covariant in the referenced constructed type
156
158
-`(ref <constype1>) <: (ref <constype2>)`
157
159
- iff `<constype1> <: <constype2>`
158
160
159
-
#### Constructed Types
161
+
#####Constructed Types
160
162
161
163
* Type `func` is a subtype of `any`
162
164
-`func <: any`
@@ -187,10 +189,7 @@ The following rules, now defined in terms of constructed types, replace and exte
187
189
188
190
* Function-level locals must have a type that is defaultable.
189
191
190
-
* Table definitions with non-zero minimum size must have an element type that is defaultable. (Imports are not affected.)
191
-
192
-
Question:
193
-
- Should we introduce a variant of table definition with explicit default initialiser?
192
+
* Table definitions with a type that is not defaultable must have an initialiser value. (Imports are not affected.)
194
193
195
194
196
195
### Instructions
@@ -254,7 +253,9 @@ TODO: This assumes that let-bound locals are mutable. Should they be?
254
253
255
254
### Tables
256
255
257
-
TODO: How to initialise tables of non-opt element type (init value? init segment?).
256
+
* Table definitions have an initialiser value: `(table <tabletype> <constexpr>)`
0 commit comments