-
Notifications
You must be signed in to change notification settings - Fork 225
VB -> C#: private partial methods do not compile #1189
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
Conversation
- Added unit test to SpecialConversionTests (not MethodStatementTests as there is no statements) -ISymbolExtensions.cs - CanHaveMethodBody & IsPartialMethodDefinition - Added check for IsPartialDefinition icsharpcode#1097
|
@GrahamTheCoder : no test results have changed, but I did add a unit test for it. Not sure it's where you'll want it. |
…owing what to do in the edge case is the caller's responsibility
|
Thanks this seems right to me - I see that IsPartialMethodDefinition can be true even when neither of the implementationpart and definitionpart are set - that was the thing that made it look odd to me I think. I'll merge it in its current state and make a few tweaks on top
As a general principle: if in doubt, and you don't have a test case that shows the issue, don't change the production behaviour. Test placement
I'd suggest MemberTests is actually the best place so I've moved it there in 81ff635 CodeConverter/Tests/CSharp/MemberTests/MemberTests.cs Lines 895 to 921 in add696c
Style
I'll do an example commit of the style I'd aim for in any new code just to demonstrate the direction, but definitely the best plan to stick with the surrounding code by default, minimum change prior to review is generally simplest. Declarative is generally preferable, so any use of pattern matching is good, but best to keep style changes in separate post-review commits or PRs. tl; drGood to merge 🚀 (so long as I didn't break anything whilst showing the style we're aiming for) |
#1097
Problem
Partial method declarations are including a body, which makes them partial method IMPLEMENTATIONS without declarations and so the resulting conversion does not compile
Solution