-
Notifications
You must be signed in to change notification settings - Fork 222
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 visibility for constructor #422
Comments
I previously tried a global approach to #349 and hit some issues (the CsSyntaxGenerator isn't as far reaching as I'd hoped), but it might be applicable here. I suspect a sensible model for these things to follow in some cases might be to use the syntaxgenerator, then replace bits using "With..." methods. |
This specific issue is related to the difference in default visibility between c# and VB. I'll add this so there is a reference to the relevant MSDN docs: Excerpt:
Here is the full breakdown for VB Here is overview for C#
and
So the default visibility for C# class members is private while VB default is public. This leads us to have to add an access modifier to keep the same behavior. |
Ensure class constructors are marked as public [#422]
Input code
Erroneous output
Expected output
Details
Visibility of constructors in visual basic is public when no other modifier is specified (can't find this in the spec, but the same happens for other methods, and ILSpy confirms).
The text was updated successfully, but these errors were encountered: