Skip to content

Cannot define variable with name that is used in getter and setter #77

Description

@TannerGabriel

When a variable is removed from a local initialization but still referenced in a getter/setter, the getter correctly shows an error (Select a valid item in the drop down). However, re-adding the initialization should resolve the error. Instead, the naming logic forces a new variable name, preventing the original reference from being restored.

Screencast.from.2025-08-27.08-30-01.webm

I assume this isn’t the intended behavior, but if it is, feel free to close this issue.

Activity

  1. added a commit that references this issue on Feb 1, 2026
  2. SurbhiAgarwal1 commented on Feb 1, 2026

    @SurbhiAgarwal1

    Hey! @TannerGabriel . I looked into this and I think I found what's happening.

    When you remove a variable but the getter is still there, the system sees that name as "in use" even though it's basically broken/orphaned. So when you try to add the variable back, it thinks there's a conflict and renames it to x2.
    I think in this we need to ignore those orphaned references when checking for name conflicts. I've got a fix ready, will open a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions