Skip to content

Rename of a member __.M() self identifier silently corrupts the code #20566

Description

@xperiandri
type RenameTest() =
    member __.TestMethod() = "Hello, World!"
    member __.TestMethodDoubleUnderscore() = __.TestMethod()

Pressing F2 on the __ in member __.TestMethodDoubleUnderscore() does nothing — no rename session starts. Pressing F2 on the __ in the body does start one, but it rewrites only the body occurrence and leaves member __. untouched, producing code that no longer compiles.

this, self and _ all rename correctly; only __ is affected. FCS reports the uses of the __ value but not its declaration, so the rename never sees the declaration to rewrite.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions