You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refstructR{publicrefintF;// warning CS0649: Field 'R.F' is never assigned to, and will always have its default value 0staticvoidM(inintx){}staticvoidTest(Rr){M(r.F);}}
compare with:
refstructR{publicrefintF;// no warningstaticvoidM(inintx){}staticvoidTest(Rr){M(inr.F);// `in` added here}}
Expected Behavior: The two code snippets are equivalent, so I would expect the warning to be either reported for both or for none of them.
Actual Behavior: The warning is reported inconsistently.
Additional Notes:
The warning is also not reported for other callsite modifiers like ref (but one cannot reproduce the "no callsite modifier" scenario there). Perhaps the warning is not supposed to be reported for ref fields at all.
If the warning should be reported for ref fields, it shouldn't say that R.F will always have its default value 0 - because it's a ref field, it will have its default value null.
The text was updated successfully, but these errors were encountered:
Version Used: 4.13.0-1.24480.10 (ba7fe35)
Steps to Reproduce:
compare with:
Expected Behavior: The two code snippets are equivalent, so I would expect the warning to be either reported for both or for none of them.
Actual Behavior: The warning is reported inconsistently.
Additional Notes:
ref
(but one cannot reproduce the "no callsite modifier" scenario there). Perhaps the warning is not supposed to be reported for ref fields at all.R.F
will always have its default value 0 - because it's a ref field, it will have its default valuenull
.The text was updated successfully, but these errors were encountered: