Skip to content
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

VB -> C#: Incorrect conversion for interface readonly property #270

Closed
mrmonday opened this Issue Apr 5, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@mrmonday
Copy link
Contributor

mrmonday commented Apr 5, 2019

Input code

Public Interface Foo
    ReadOnly Property Something() As String
End Interface

Erroneous output

public interface Foo
{
    string Something { get; private set; }
}

Expected output

public interface Foo
{
    string Something { get; }
}

Details

Product in use: VS extension

Version in use: e.g. 6.6.0

@GrahamTheCoder

This comment has been minimized.

Copy link
Member

GrahamTheCoder commented Apr 8, 2019

I've erred on the side of caution when fixing #237
To improve this we'd need to find usages of the implicit backing field variable and take it into account here:
13cd01b#diff-efcb0f9eb87a44613f68d268a25cb12dR456

@GrahamTheCoder GrahamTheCoder changed the title VB -> C#: Incorrect conversion for readonly property VB -> C#: Use more idiomatic get only property where possible Apr 8, 2019

@mrmonday

This comment has been minimized.

Copy link
Contributor Author

mrmonday commented Apr 8, 2019

This actually gives a compilation error, which is why I reported it - sorry I forgot to include that in the report:

https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0275

@GrahamTheCoder

This comment has been minimized.

Copy link
Member

GrahamTheCoder commented Apr 8, 2019

Ah sorry, I missed the fact it was on an interface. Yup that's a bug right there. It will have been introduced in #237, so should be an easy fix when looking through that.

@GrahamTheCoder GrahamTheCoder changed the title VB -> C#: Use more idiomatic get only property where possible VB -> C#: Incorrect conversion for interface readonly property Apr 8, 2019

mrmonday added a commit to mrmonday/CodeConverter that referenced this issue Apr 18, 2019

@mrmonday mrmonday referenced this issue Apr 18, 2019

Merged

Do not output private get/set for interfaces #286

2 of 2 tasks complete

GrahamTheCoder added a commit to mrmonday/CodeConverter that referenced this issue Apr 19, 2019

Do not output private get/set for interfaces
Closes icsharpcode#270

# Conflicts:
#	ICSharpCode.CodeConverter/CSharp/NodesVisitor.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.