Avoiding using recursive pattern matching#37451
Conversation
|
Tagging subscribers to this area: @eerhardt |
trylek
left a comment
There was a problem hiding this comment.
LGTM, thanks Andrew for driving the ILSpy efforts!
Do you want to change the LangVersion in the csproj to enforce that? |
I fiddled with it for a bit, it appears that the build simply ignore whatever that I put in the Even this compile (using There must be something special with |
|
@cshung to figure out why, you could maybe add "/pp out.txt" to the MSBuild command line and then grep for seems coming from here: Maybe this should be |
Thanks @danmosemsft, I figured. It appears you're right that |
|
@safern for the directory.build.targets edit |
|
Would another possible fix be to undo #33868, which would move the defaulting of Directory.Build.props: <!-- default to allowing all language features -->
<LangVersion>latest</LangVersion>
<LangVersion Condition="'$(MSBuildProjectExtension)' == '.csproj'">preview</LangVersion>Then projects in the repo can just set <LangVersion>X.Y</LangVersion>as usual. |
See the discussion in that issue about it not working in the .props.
That's not the standard mechanism for this, is it? Seems like another workaround that'll just cause confusion the next time someone tries to do something in this area. But I don't actually have a strong opinion. I was following @ViktorHofer's advice and will defer to him again :) |
I read the discussion, but didn't see any mention of |
This reverts commit a8e9d21.
|
In order to unblock ILSpy quicker, I reverted the change to fix the LangVersion issue and filed #37498 to track the work to enable the build to fail when feature not available in C# 7.3 is used. |
That seems a reasonable approach. |
For ILSpy usage, we need to avoid any C# feature that is not available in C# 7.3