Skip to content

fix: compiler crashed when duplicate inner function declared in function body#3000

Open
Changqing-JING wants to merge 5 commits intoAssemblyScript:mainfrom
Changqing-JING:bugfix/2999
Open

fix: compiler crashed when duplicate inner function declared in function body#3000
Changqing-JING wants to merge 5 commits intoAssemblyScript:mainfrom
Changqing-JING:bugfix/2999

Conversation

@Changqing-JING
Copy link
Copy Markdown
Contributor

@Changqing-JING Changqing-JING commented Mar 26, 2026

Fixes #2999

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@Changqing-JING Changqing-JING changed the title fix: compiler crashed when duplicate inner function declared in funct… fix: compiler crashed when duplicate inner function declared in function body Mar 26, 2026
@Changqing-JING Changqing-JING marked this pull request as draft March 26, 2026 08:32
@MaxGraey
Copy link
Copy Markdown
Member

MaxGraey commented Mar 26, 2026

Can you also add this tests case?

export function testMixed(): void {
  const inner = function (): void {}
  function inner(): void {}
  inner();
}

In this case emit Duplicate identifier 'inner'

@Changqing-JING Changqing-JING marked this pull request as draft March 27, 2026 04:13
@Changqing-JING
Copy link
Copy Markdown
Contributor Author

Can you also add this tests case?

export function testMixed(): void {
  const inner = function (): void {}
  function inner(): void {}
  inner();
}

In this case emit Duplicate identifier 'inner'

Good point, I also added this in testcase

@Changqing-JING Changqing-JING requested a review from MaxGraey March 27, 2026 04:18
@Changqing-JING Changqing-JING marked this pull request as ready for review March 27, 2026 04:22
@MaxGraey MaxGraey requested a review from CountBleck March 27, 2026 12:04
@Changqing-JING Changqing-JING requested a review from MaxGraey March 27, 2026 14:03
@MaxGraey MaxGraey requested a review from HerrCai0907 March 27, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compiler crashed when duplicate inner function define in function body

2 participants