-
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
List-patterns: mitigate break with Length property patterns #56721
Conversation
@@ -806,7 +806,7 @@ public static void Multiple(bool includeStackTrace, params Action[] assertions) | |||
return; | |||
|
|||
var stringBuilder = new StringBuilder($"{exceptions.Count} out of {assertions.Length} assertions failed."); | |||
foreach (var (index, ex) in exceptions) | |||
foreach (var (index, ex) in exceptions.OrderBy(e => e.Index)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we need to do this (why?) there's no need to run assertions in the reverse order above.
case ErrorCode.WRN_SwitchArmSubsumedIfNonNegativeLength: | ||
case ErrorCode.WRN_IsPatternAlwaysIfNonNegativeLength: | ||
case ErrorCode.WRN_IsPatternImpossibleIfNonNegativeLength: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these be reported for level 7 only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LDM discussed a regular warning (as a documented breaking change), not a warning wave warning.
From discussion with LDM today (10/13/2021) we're leaning towards taking the break after all. We'll revisit if some real-world types hit this issue in some serious way. |
Language design issue: dotnet/csharplang#5226
Relates to test plan #51289
TODO: