Skip to content

Commit 0553d16

Browse files
Add diagnostic when referencing a generic function without type parameters (#1182)
1 parent 077e9f6 commit 0553d16

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/compiler.ts

+10
Original file line numberDiff line numberDiff line change
@@ -7941,6 +7941,16 @@ export class Compiler extends DiagnosticEmitter {
79417941
}
79427942
case ElementKind.FUNCTION_PROTOTYPE: {
79437943
let functionPrototype = <FunctionPrototype>target;
7944+
let typeParameterNodes = functionPrototype.typeParameterNodes;
7945+
7946+
if (typeParameterNodes !== null && typeParameterNodes.length != 0) {
7947+
this.error(
7948+
DiagnosticCode.Expected_0_arguments_but_got_1,
7949+
expression.range, typeParameterNodes.length.toString(), "0"
7950+
);
7951+
return module.unreachable();
7952+
}
7953+
79447954
let functionInstance = this.resolver.resolveFunction(
79457955
functionPrototype,
79467956
null,

0 commit comments

Comments
 (0)