Skip to content

Commit d438bc2

Browse files
committed
Feature(compiler): NativeTypeResolver - return null on too dynamic types
1 parent dc723d4 commit d438bc2

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

src/backend/llvm/native-type-resolver.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ import {Context} from "./context";
55
import {NativeType} from "./native-type";
66

77
export class NativeTypeResolver {
8-
static getType(type: ts.Type, ctx: Context): NativeType {
9-
if (type.isClass()) {
10-
return new NativeType(
11-
llvm.Type.getInt8PtrTy(
12-
ctx.llvmContext
13-
)
14-
);
15-
}
16-
8+
static getType(type: ts.Type, ctx: Context): NativeType|null {
179
if (type.isNumberLiteral() || (<any>type).intrinsicName === 'number') {
1810
return new NativeType(
1911
llvm.Type.getDoubleTy(
@@ -135,8 +127,6 @@ export class NativeTypeResolver {
135127
}
136128
}
137129

138-
throw new Error(
139-
`Unsupported type, it's to dynamic`
140-
);
130+
return null;
141131
}
142132
}

0 commit comments

Comments
 (0)