Interface AnyType
- All Known Implementing Classes:
ArrayType
,TypeManager.BlockType
,TypeManager.LambdaType
,TypeManager.StructType
,ValueType
public interface AnyType
Interface of all possible types in WebAssembly. This are predefined (native) types and custom types in the type section.
numtype ::= i32 | i64 | f32 | f64
packedtype ::= i8 | i16
reftype ::= anyref | funcref | nullref
valtype ::= numtype | reftype
deftype ::= functype | structtype | arraytype
storagetype ::= valtype | packedtype
-
Method Summary
Modifier and TypeMethodDescriptionint
getCode()
The type code(typeidx) in WebAssembly.boolean
If the type is a reference type.boolean
isSubTypeOf
(AnyType other) Check if this is a sub type of given type.
-
Method Details
-
getCode
int getCode()The type code(typeidx) in WebAssembly. Predefined types have an negative typeidx. Custom types have the positive index in the type section.- Returns:
- the code
-
isRefType
boolean isRefType()If the type is a reference type. A GC reference to the heap.- Returns:
- true, is GC type
-
isSubTypeOf
Check if this is a sub type of given type.- Parameters:
other
- type to check- Returns:
- true, if both are identical or this is a sub type of
other
. Or ifother
is a parent type of this.
-