dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.04k stars 4.03k forks source link

Refactorings should escape contextual keywords when necessary #8367

Closed dpoeschl closed 2 weeks ago

dpoeschl commented 8 years ago

Ported from 132970

Module Program
    Sub Main()
        Dim y = 1 ' Rename y to yield
        Dim f = Iterator Function()
                    y = 2
                End Function
    End Sub
End Module

ACTUAL:

Module Program
    Sub Main()
        Dim yield = 1
        Dim f = Iterator Function()
                    Yield = 2 ' error BC30201: Expression expected.
                End Function
    End Sub
End Module

EXPECTED:

Module Program
    Sub Main()
        Dim yield = 1
        Dim f = Iterator Function()
                    [yield] = 2 ' OK
                End Function
    End Sub
End Module
dpoeschl commented 8 years ago

Probably not specific to rename.

CyrusNajmabadi commented 2 weeks ago

Closing out as we haven't heard anything about this.