Types¶
Most types are universally valid. However, restrictions apply to limits, which must be checked during validation. Moreover, block types are converted to plain function types for ease of processing.
Limits¶
Limits must have meaningful bounds that are within a given range.
¶
The value of
must not be larger than .If the maximum
is not empty, then:Its value must not be larger than
.Its value must not be smaller than
.
Then the limit is valid within range
.
Block Types¶
Block types may be expressed in one of two forms, both of which are converted to plain function types by the following rules.
¶
The type
must be defined in the context.Then the block type is valid as function type
.
¶
The block type is valid as function type
.
Function Types¶
Function types are always valid.
¶
The function type is valid.
Table Types¶
¶
The limits
must be valid within range .Then the table type is valid.
Memory Types¶
¶
The limits
must be valid within range .Then the memory type is valid.
Global Types¶
¶
The global type is valid.
External Types¶
¶
The function type
must be valid.Then the external type is valid.
¶
The table type
must be valid.Then the external type is valid.
¶
The memory type
must be valid.Then the external type is valid.
¶
The global type
must be valid.Then the external type is valid.
Import Subtyping¶
When instantiating a module,
external values must be provided whose types are matched against the respective external types classifying each import.
In some cases, this allows for a simple form of subtyping (written “
Limits¶
Limits
is larger than or equal to .Either:
is empty.
Or:
Both
and are non-empty. is smaller than or equal to .
Functions¶
An external type
Both
and are the same.
Tables¶
An external type
Limits
match .Both
and are the same.
Memories¶
An external type
Limits
match .
Globals¶
An external type
Both
and are the same.