@@ -81,25 +81,47 @@ export namespace TypeRef {
8181 export const StringviewWTF8 = binaryen . _BinaryenTypeStringviewWTF8 ( ) ;
8282 export const StringviewWTF16 = binaryen . _BinaryenTypeStringviewWTF16 ( ) ;
8383 export const StringviewIter = binaryen . _BinaryenTypeStringviewIter ( ) ;
84+ // bottom types
85+ export const Noneref = binaryen . _BinaryenTypeNullref ( ) ;
86+ export const Nofuncref = binaryen . _BinaryenTypeNullFuncref ( ) ;
87+ export const Noexternref = binaryen . _BinaryenTypeNullExternref ( ) ;
8488
8589 export const Auto : TypeRef = - 1 /* _BinaryenTypeAuto */ ;
8690}
8791
8892/** Reference to a Binaryen heap type. */
8993export type HeapTypeRef = binaryen . HeapTypeRef ;
9094export namespace HeapTypeRef {
95+
96+ // any extern func
97+ // | | |
98+ // __ eq __ noextern (...)
99+ // / | \ |
100+ // i31 struct array nofunc
101+ // | | |
102+ // none (...) (...)
103+ // | |
104+ // none none
105+ //
106+ // where (...) represents the concrete subtypes
107+
91108 // reference & GC heap types
92- export const Ext : HeapTypeRef = binaryen . _BinaryenHeapTypeExt ( ) ;
109+ export const Extern : HeapTypeRef = binaryen . _BinaryenHeapTypeExt ( ) ;
93110 export const Func : HeapTypeRef = binaryen . _BinaryenHeapTypeFunc ( ) ;
94111 export const Any : HeapTypeRef = binaryen . _BinaryenHeapTypeAny ( ) ;
95112 export const Eq : HeapTypeRef = binaryen . _BinaryenHeapTypeEq ( ) ;
96113 export const I31 : HeapTypeRef = binaryen . _BinaryenHeapTypeI31 ( ) ;
97- export const Data : HeapTypeRef = binaryen . _BinaryenHeapTypeData ( ) ;
114+ export const Data : HeapTypeRef = binaryen . _BinaryenHeapTypeData ( ) ; // TODO: struct
115+ // export const Array: HeapTypeRef = binaryen._BinaryenHeapTypeArray(); // TODO
98116 // string heap types
99117 export const String : HeapTypeRef = binaryen . _BinaryenHeapTypeString ( ) ;
100118 export const StringviewWTF8 : HeapTypeRef = binaryen . _BinaryenHeapTypeStringviewWTF8 ( ) ;
101119 export const StringviewWTF16 : HeapTypeRef = binaryen . _BinaryenHeapTypeStringviewWTF16 ( ) ;
102120 export const StringviewIter : HeapTypeRef = binaryen . _BinaryenHeapTypeStringviewIter ( ) ;
121+ // bottom heap types
122+ export const None : HeapTypeRef = 10 ; /* TODO_BinaryenHeapTypeNone */
123+ export const Noextern : HeapTypeRef = 11 ; /* TODO_BinaryenHeapTypeNoext */
124+ export const Nofunc : HeapTypeRef = 12 ; /* TODO_BinaryenHeapTypeNofunc */
103125}
104126
105127/** Packed array element respectively struct field types. */
@@ -3699,7 +3721,7 @@ function tryEnsureBasicType(type: Type): TypeRef {
36993721 return binaryen . _BinaryenTypeFromHeapType ( HeapTypeRef . Func , type . is ( TypeFlags . NULLABLE ) ) ;
37003722 }
37013723 case TypeKind . EXTERNREF : {
3702- return binaryen . _BinaryenTypeFromHeapType ( HeapTypeRef . Ext , type . is ( TypeFlags . NULLABLE ) ) ;
3724+ return binaryen . _BinaryenTypeFromHeapType ( HeapTypeRef . Extern , type . is ( TypeFlags . NULLABLE ) ) ;
37033725 }
37043726 case TypeKind . ANYREF : {
37053727 return binaryen . _BinaryenTypeFromHeapType ( HeapTypeRef . Any , type . is ( TypeFlags . NULLABLE ) ) ;
0 commit comments