-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update LangVersion to C# 9 #4748
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
|
Why not |
|
Has WPF adopted C# 9's module initializer support yet for PresentationCore, and stopped using ILDAsm/ILAsm round-tripping ? If not, then do that first before doing this here. |
|
@RussKie, I didn't update to @vatsan-madhavan As far as I know, WPF didn't migrate to C# 9 module initializer and the issue about this is sill opened (#3885). I'm not sure how this would block this PR though. Maybe you were talking about @RussKie's comment ? |
|
ILDasm-ILAsm roundtripping, from what I'd heard at that time, doesn't always keep pace with language improvements. I chose to fix the If this situation has improved - i.e., if ILDasm/ILAsm round-tripping has become more robust over the past ~year, then changing That said, #3885 is not a hard problem; I view it as an ~1 day effort item. /cc @rladuca, @danmoseley |
|
We
|
|
See #4889 |
|
@vatsan-madhavan and @SamBent: I've replaced the IL injection with System.Runtime.CompilerServices.ModuleInitializerAttribute, but diff'ing the IL from each shows significant differences beyond the module initializer. My expectation was that the IL injection would only modify what is necessary to simulate the module initializer, yet there are all sorts of minor changes unrelated to the initializer in the IL. Anyway, the module initializer without IL injection is working as expected:
|
I think what might be happening is that we were round-tripping IL. The tasks would disassemble the entire |
|
Thanks, everyone, for the guidance. |
Description
Update LangVersion to C# 9. WPF seems to be the only repo that still use C# 8.
Here's a list of popular dotnet repos and their version:
aspnetcore: 9.0
efcore: 9.0
runtime: preview
winforms: preview
This change allows us to use newer feature (E.g. Static anonymous functions: #4717 (comment))
Customer Impact
None
Regression
No
Testing
I tested by doing a build locally.
Risk
There shouldn't be any risk, C# 9 is already the default version for .Net 6.