Skip to content

fix(declarations): prevent panic for KindArrowFunction parameter visibility - #4638

Closed
kimyeongrae23 wants to merge 1 commit into
microsoft:mainfrom
kimyeongrae23:fix/issue-4629-arrow-function-panic
Closed

fix(declarations): prevent panic for KindArrowFunction parameter visibility#4638
kimyeongrae23 wants to merge 1 commit into
microsoft:mainfrom
kimyeongrae23:fix/issue-4629-arrow-function-panic

Conversation

@kimyeongrae23

Copy link
Copy Markdown

Fixes #4629

Problem

getParameterDeclarationTypeVisibilityDiagnosticMessage panics with "Unknown parent for parameter: KindArrowFunction" when declaration emit encounters an arrow function parameter whose type references an unnameable symbol.

Root cause

The switch on node.Parent.Kind handles many parent kinds (Constructor, MethodDeclaration, FunctionDeclaration, etc.) but misses KindArrowFunction and KindFunctionExpression.

Fix

Add ast.KindArrowFunction and ast.KindFunctionExpression to the function-like case, reusing the existing "exported function" parameter diagnostic message — consistent with how KindFunctionDeclaration and KindFunctionType are handled.

Change

  • internal/transformers/declarations/diagnostics.go: add missing KindArrowFunction and KindFunctionExpression to the KindFunctionDeclaration, KindFunctionType case.

@kimyeongrae23
kimyeongrae23 force-pushed the fix/issue-4629-arrow-function-panic branch from 3356e8b to 27686f4 Compare July 14, 2026 17:26
@jakebailey

Copy link
Copy Markdown
Member

#4648

@jakebailey jakebailey closed this Jul 21, 2026
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.

panic: Unknown parent for parameter: KindArrowFunction

2 participants