Add partial method modifier support for Value, From and TryFrom#847
Conversation
|
Thanks for the PR @DPDmancul . This is for C# 14 right? I guess we'll need to determine the version of Roslyn loaded and or the language version, before generating the partial methods. |
I ran the tests with C# 12, but it should work also for lower versions. Only for using the partial keyword with properties (e.g.
Indeed the problem in the CI tests is that the Since the version of |
2cf0d99 to
dce1621
Compare
… support older Roslyn versions
dce1621 to
393b4a5
Compare
|
Since there is no direct correspondence between target framework and Roslyn versions, I added a runtime fallback. Instead of directly calling the property, I try to get the property with reflection and return a fallback value ( |
1055712 to
f99add9
Compare
f99add9 to
d2659ee
Compare
|
I think we're nearly there @DPDmancul ! Thanks for your hard work on this one; apologies, I know it's quite difficult even to get the simplest of changes into Vogen! It looks like the last hurdle is to fix the snapshot tests. You can run them from the IDE, or from the command line. If I'm fairly certain that my changes are all correct, I run |
SteveDunn
left a comment
There was a problem hiding this comment.
LGTM! Thank you for the great contribution!
This solves #845 for
Value,FromandTryFrom. It could be easily extended to support alsoTryParseand other methods.This enables: