File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,3 +18,11 @@ interface Array<T = any> {}
1818declare function puts ( str : string ) : void ;
1919
2020declare function number2string ( value : number ) : string ;
21+
22+ declare type int8 = { } ;
23+ declare type int16 = { } ;
24+ declare type int32 = { } ;
25+ declare type int64 = { } ;
26+ declare type int128 = { } ;
27+
28+ // RSTP - Real Static Type Script
Original file line number Diff line number Diff line change @@ -23,6 +23,36 @@ export class NativeTypeResolver {
2323 ) ;
2424 }
2525
26+ const aliasSymbol = type . aliasSymbol ;
27+ if ( aliasSymbol ) {
28+ switch ( aliasSymbol . escapedName ) {
29+ case 'int8' :
30+ return llvm . Type . getInt8Ty (
31+ ctx . llvmContext
32+ ) ;
33+ case 'int16' :
34+ return llvm . Type . getInt16Ty (
35+ ctx . llvmContext
36+ ) ;
37+ case 'int32' :
38+ return llvm . Type . getInt32Ty (
39+ ctx . llvmContext
40+ ) ;
41+ case 'int64' :
42+ return llvm . Type . getInt64Ty (
43+ ctx . llvmContext
44+ ) ;
45+ case 'int128' :
46+ return llvm . Type . getInt128Ty (
47+ ctx . llvmContext
48+ ) ;
49+ default :
50+ throw new Error (
51+ `Unsupported type, "${ < string > aliasSymbol . escapedName } "`
52+ ) ;
53+ }
54+ }
55+
2656 throw new Error (
2757 `Unsupported type, it's to dynamic`
2858 ) ;
You can’t perform that action at this time.
0 commit comments