Conversation
AlekseyTs
commented
Feb 18, 2026
- Null pattern for classes
- TryGetValue nullable analysis
- Null pattern for classes - TryGetValue nullable analysis
| applyMemberPostConditions(receiverSlot, type, notNullWhenFalseMembers, ref StateWhenFalse); | ||
| } | ||
|
|
||
| if (method is MethodSymbol |
There was a problem hiding this comment.
It might be reasonable to share the isTryGetValueSignature helper from GetUnionTypeTryGetValueMethod here.
There was a problem hiding this comment.
It might be reasonable to share the
isTryGetValueSignaturehelper fromGetUnionTypeTryGetValueMethodhere.
If I remember correctly the logic doesn't match exactly.
| CompileAndVerify(comp1, expectedOutput: "1323 -1-3-2-3").VerifyDiagnostics( | ||
| // (26,50): hidden CS9335: The pattern is redundant. | ||
| // return u switch { int => 1, string => 2, null => 3 }; | ||
| Diagnostic(ErrorCode.HDN_RedundantPattern, "null").WithLocation(26, 50), |
There was a problem hiding this comment.
This warning still seems misleading, per the prototype comment from before this change. Should the prototype comment be restored? #Resolved
There was a problem hiding this comment.
This warning still seems misleading, per the prototype comment from before this change. Should the prototype comment be restored?
No the hidden diagnostic is expected now, null can be replaced with an _ and the meaning won't change
There was a problem hiding this comment.
I keep missing the HDN_ prefix on these.
|
Test failure looks like an infra issue. |
|
@333fred, @dotnet/roslyn-compiler For a second review |
1 similar comment
|
@333fred, @dotnet/roslyn-compiler For a second review |