Skip to content

Conversation

ahejlsberg
Copy link
Member

Fixes #1650.

@Copilot Copilot AI review requested due to automatic review settings August 31, 2025 14:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where the code was attempting to call AsVariableDeclarationList() on a node without first verifying that the node is actually a variable declaration list, which could cause a runtime panic.

  • Adds a missing type check for ast.IsVariableDeclarationList(node.Parent) before calling AsVariableDeclarationList()

@ahejlsberg ahejlsberg requested a review from jakebailey August 31, 2025 14:24
@jakebailey
Copy link
Member

jakebailey commented Aug 31, 2025

Same as #1651, right? (That one has a test)

@ahejlsberg
Copy link
Member Author

Yeah, didn't see that one.

@ahejlsberg ahejlsberg closed this Aug 31, 2025
@jakebailey jakebailey deleted the fix-1650 branch August 31, 2025 14:53
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.

[lsp] panic when hovering error in catch(error)
2 participants