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
S1450 is raised on the following snippet despite foundMultiple being used on both methods
Repro steps
privateclassLookForSinglePropertyAccessExpressionVisitor:ExpressionVisitor{privatePropertyInfofoundProperty;privateboolfoundMultiple;// S1450 FP here (but it's used on both methods)publicPropertyInfoGetUsedProperty(Expressionexpression){foundProperty=null;foundMultiple=false;Visit(expression);if(foundMultiple){thrownewArgumentException($"{expression} contains more than one property access",nameof(expression));}returnfoundProperty??thrownewArgumentException($"{expression} contains no property access",nameof(expression));}protectedoverrideExpressionVisitMember(MemberExpressionnode){if(node.MemberisPropertyInfoprop){if(foundProperty!=null){foundMultiple=true;}foundProperty=prop;}returnbase.VisitMember(node);}}
It's a FP, indeed.
I discovered that we already have a reproducer for this on our repo.
I'll make sure to add a link to this since it seems we don't have a ticket for it yet.
Description
S1450 is raised on the following snippet despite
foundMultiple
being used on both methodsRepro steps
Expected behavior
No occurrence of S1450 in the above snippet
Actual behavior
S1450 is raised on the above snippet despite
foundMultiple
being used on both methodsKnown workarounds
None
Related information
The text was updated successfully, but these errors were encountered: