-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[Strict] Do not ignore private reference fields of structs for definite assignment #30194
Comments
Here is a first draft of a proposal for this (to address dotnet/csharplang#3431) There are two ways of doing data flow analysis. The strong version includes tracking inaccessible fields of structs. The weak version ignores inaccessible fields. (The precise rule is a bit more subtle. I believe we only ignore fields of reference type in the weak version). The compiler currently runs the weak version except in “strict” mode, in which case we run the strong version. We propose to make the following changes in the C# 9 (dotnet 5) timeframe.
|
A simpler alternative proposal would be If any of the following conditions are true, we run the strong version of analysis
otherwise we run the weak version of analysis. |
We settled on the first approach. However, we will not treat
|
…rom metadata. Fixes dotnet#30194
…rom metadata. Fixes dotnet#30194
In Dev12 the C# compiler ignored private fields of reference type in a value type imported from metadata when computing definite assignment. Roslyn duplicates that bug for compatibility. In "strict" mode we do not duplicate that bug.
Consider enabling this bug to be fixed in the first warning wave.
The text was updated successfully, but these errors were encountered: