Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7756,6 +7756,14 @@ export class Compiler extends DiagnosticEmitter {
uniqueMap<string,Type>(flow.contextualTypeArguments)
);
if (!functionInstance || !this.compileFunction(functionInstance)) return module.unreachable();
if (functionInstance.hasDecorator(DecoratorFlags.BUILTIN)) {
this.error(
DiagnosticCode.Not_implemented_0,
expression.range, "First-class built-ins"
);
this.currentType = functionInstance.type;
return module.unreachable();
}
if (contextualType.isExternalReference) {
this.currentType = Type.funcref;
return module.ref_func(functionInstance.internalName, TypeRef.Funcref); // TODO
Expand Down
24 changes: 24 additions & 0 deletions tests/compiler/issues/2202.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"asc_flags": [
],
"stderr": [
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"AS100: Not implemented: First-class built-ins",
"EOF"
]
}
18 changes: 18 additions & 0 deletions tests/compiler/issues/2202.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
i16;
i32;
i64;
u8;
u16;
u32;
u64;
bool;
f32;
f64;
v128;
i8x16;
i16x8;
i32x4;
i64x2;
f32x4;
f64x2;
ERROR("EOF");