Skip to content

Port "Fix flow node improper reuse" #1082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Jun 6, 2025

@Copilot Copilot AI review requested due to automatic review settings June 6, 2025 07:09
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

Ports the fix for improper reuse of flow nodes by clearing the FlowNode on FlowNodeData when a node is unreachable.

  • Clears the FlowNode field for unreachable nodes to avoid reuse
  • Keeps existing JSDoc parent binding and child traversal sequence intact
Comments suppressed due to low confidence (2)

internal/binder/binder.go:1568

  • [nitpick] The variable name hasFlowNodeData suggests a boolean, but it holds a FlowNodeData pointer; consider renaming it to flowNodeData for clarity.
hasFlowNodeData := node.FlowNodeData()

internal/binder/binder.go:1568

  • Consider adding a unit test for the case where checkUnreachable(node) returns true, verifying that FlowNode is cleared to prevent improper reuse.
if b.checkUnreachable(node) {

Co-authored-by: Gabriela Araujo Britto <[email protected]>
@Andarist Andarist force-pushed the port/gabritto/issue60597 branch from 6462dd4 to 485a368 Compare June 6, 2025 08:42
@ahejlsberg
Copy link
Member

We're not doing incremental parsing in Corsa. When a source file is modified, we always completely rebuild the AST. So, I don't think there's a scenario where the code in this PR is needed.

@Andarist
Copy link
Contributor Author

Andarist commented Jun 6, 2025

That's cool 👍 I was wondering if the AST reuse is still done here

@Andarist Andarist closed this Jun 6, 2025
@jakebailey
Copy link
Member

Marked this as not needed on the PR board.

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.

None yet

3 participants