Skip to content

Commit b566d0a

Browse files
committed
fixed bug where const params in source 1/2 can be functions
1 parent 7015f50 commit b566d0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/rules/callExpression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const callExpressionRule = new class extends Rule<CallExpression> {
1818
let declaration = ast.findDeclarationByName(callee.name, loc)
1919
if (declaration !== undefined) {
2020
// We cannot check for let because they can be reassigned. Constants assigned to lambdas will still be "func"
21-
if (declaration.meta === "const")
21+
if (declaration.meta === "const" && declaration.declarationKind !== DeclarationKind.KIND_PARAM)
2222
ast.addDiagnostic(`'${callee.name}' is not a function`, DiagnosticSeverity.Error, loc);
2323
if (declaration.parameters !== undefined || declaration.declarationKind === DeclarationKind.KIND_IMPORT) {
2424
let hasRestElement = false;

0 commit comments

Comments
 (0)