icsharpcode / CodeConverter

Convert code from C# to VB.NET and vice versa using Roslyn
https://icsharpcode.github.io/CodeConverter/
MIT License
840 stars 218 forks source link

VB -> C#: statics in methods with escaped names get invalid names #1043

Closed TymurGubayev closed 11 months ago

TymurGubayev commented 12 months ago

VB.Net input code

Public Class KeywordName
    Sub [Step]()
        Static i As Integer
    End Sub
End Class

Erroneous output

    public class KeywordName
    {
        private int _[Step]_i;
        public void Step()
        {
        }
    }

Expected output

    public class KeywordName
    {
        private int _Step_i;
        public void Step()
        {
        }
    }

Details

GrahamTheCoder commented 12 months ago

Same area of code as https://github.com/icsharpcode/CodeConverter/issues/1044

TymurGubayev commented 11 months ago

the issue is still there, the expected code in the test is incorrect

GrahamTheCoder commented 11 months ago

New attempted fix in 825cc5e1235bce46416921c402d9a96ee596bb76