fix: compiler crashed when duplicate inner function declared in function body#3000
Open
Changqing-JING wants to merge 2 commits intoAssemblyScript:mainfrom
Open
fix: compiler crashed when duplicate inner function declared in function body#3000Changqing-JING wants to merge 2 commits intoAssemblyScript:mainfrom
Changqing-JING wants to merge 2 commits intoAssemblyScript:mainfrom
Conversation
Changqing-JING
added a commit
to wasm-ecosystem/warpo
that referenced
this pull request
Mar 26, 2026
…unction body (#439) carried over from AssemblyScript/assemblyscript#3000
MaxGraey
reviewed
Mar 26, 2026
Comment on lines
+7196
to
+7199
| this.error( | ||
| DiagnosticCode.Duplicate_identifier_0, | ||
| declaration.name.range, declaration.name.text | ||
| ); |
Member
There was a problem hiding this comment.
Suggested change
| this.error( | |
| DiagnosticCode.Duplicate_identifier_0, | |
| declaration.name.range, declaration.name.text | |
| ); | |
| this.error( | |
| DiagnosticCode.Duplicate_function_implementation, | |
| declaration.name.range | |
| ); |
It will be match with TS error
MaxGraey
reviewed
Mar 26, 2026
Comment on lines
+4
to
+14
| export function test(): void { | ||
| function inner(): i32 { | ||
| let x: i32 = 0; | ||
| return x; | ||
| } | ||
| function inner(): i32 { | ||
| let x: i32 = 0; | ||
| return x + 1; | ||
| } | ||
| inner(); | ||
| } |
Member
There was a problem hiding this comment.
Simplify to:
Suggested change
| export function test(): void { | |
| function inner(): i32 { | |
| let x: i32 = 0; | |
| return x; | |
| } | |
| function inner(): i32 { | |
| let x: i32 = 0; | |
| return x + 1; | |
| } | |
| inner(); | |
| } | |
| export function test(): void { | |
| function inner(): void {} | |
| function inner(): void {} | |
| inner(); | |
| } |
Member
|
Can you also add this tests case? export function testMixed(): void {
const inner = function (): void {}
function inner(): void {}
inner();
}In this case emit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2999 .
Changes proposed in this pull request:
⯈
⯈
⯈