Skip to content

Commit 4a46e98

Browse files
authored
[spec] Define the syntax of exact heap types (#93)
1 parent 93aa0db commit 4a46e98

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

document/core/syntax/types.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ $${syntax: {absheaptype/syn heaptype}}
110110

111111
A heap type is either *abstract* or *concrete*.
112112
A concrete heap type consists of a :ref:`type use <syntax-typeuse>` that classifies an object of the respective :ref:`type <syntax-type>` defined in a module.
113+
A concrete heap type may be *exact*, in which case it classifies objects of precisely the respective :ref:`type <syntax-type>` and not any other type that may :ref:`match <match-heaptype>` it.
113114
Abstract types are denoted by individual keywords.
114115

115116
The type ${:FUNC} denotes the common supertype of all :ref:`function types <syntax-functype>`, regardless of their concrete definition.

document/core/util/macros.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@
238238
.. |REF| mathdef:: \xref{syntax/types}{syntax-reftype}{\K{ref}}
239239
.. |NULL| mathdef:: \xref{syntax/types}{syntax-reftype}{\K{null}}
240240

241+
.. |EXACT| mathdef:: \xref{syntax/types}{syntax-heaptype}{\K{exact}}
241242
.. |ANY| mathdef:: \xref{syntax/types}{syntax-heaptype}{\K{any}}
242243
.. |EQT| mathdef:: \xref{syntax/types}{syntax-heaptype}{\K{eq}}
243244
.. |I31| mathdef:: \xref{syntax/types}{syntax-heaptype}{\K{i\scriptstyle31}}

specification/wasm-latest/1.2-syntax.types.spectec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ syntax typevar hint(desc "type variable") =
4141
| _IDX typeidx | REC n hint(show REC.%)
4242

4343
syntax heaptype hint(desc "heap type") =
44-
| absheaptype | typeuse
44+
| absheaptype | typeuse | EXACT typeuse
4545

4646
syntax reftype hint(desc "reference type") =
4747
| REF null? heaptype

0 commit comments

Comments
 (0)