-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEBugFeature - IDE0044Make field readonlyMake field readonlyIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactoringsResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented
Milestone
Description
Version Used:
16.0.0 Preview 2.0
Steps to Reproduce:
public class C
{
private int a, b; // IDE0044
private ref int select(bool c) => ref (c ? ref a : ref b);
public void Test() => select(true) = 3;
}Expected Behavior:
The members are mutated. Marking them readonly breaks the code, so IDE0044 shouldn't trigger.
Actual Behavior:
IDE0044 is falsely triggered.
mikernet
Metadata
Metadata
Assignees
Labels
Area-IDEBugFeature - IDE0044Make field readonlyMake field readonlyIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactoringsResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented