Skip to content

Commit 5e28dbb

Browse files
Revert "fix(as): compiler crashed when duplicate inner function declared in function body (#439)"
This reverts commit b4aa74c.
1 parent 9aeeddd commit 5e28dbb

3 files changed

Lines changed: 0 additions & 29 deletions

File tree

assemblyscript/src/compiler.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7820,18 +7820,6 @@ export class Compiler extends DiagnosticEmitter {
78207820
let sourceFunction = flow.targetFunction;
78217821
let isNamed = declaration.name.text.length > 0;
78227822
let isSemanticallyAnonymous = !isNamed || contextualType != Type.void;
7823-
7824-
// Check for duplicate named function declarations before creating the
7825-
// prototype, since registering a concrete element with a duplicate
7826-
// internalName would trigger an assertion error.
7827-
if (!isSemanticallyAnonymous) {
7828-
let existingLocal = flow.getScopedLocal(declaration.name.text);
7829-
if (existingLocal) {
7830-
this.error(DiagnosticCode.Duplicate_identifier_0, declaration.name.range, declaration.name.text);
7831-
return this.module.unreachable();
7832-
}
7833-
}
7834-
78357823
let closureInfo = this.program.closureScanner.getClosureFunctionInfo(declaration);
78367824
let prototype = new FunctionPrototype(
78377825
isSemanticallyAnonymous

tests/frontend/compiler/duplicate-function-in-scope.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/frontend/compiler/duplicate-function-in-scope.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)