Fixes for a couple pattern tests.

Change-Id: I117890c1117dacac9be11bd1775e8bc42a935c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Konstantin Shcheglov
2023-04-03 17:35:10 +00:00
committed by Commit Queue
parent f1007d4aa2
commit e2520f88ef
2 changed files with 4 additions and 3 deletions
@@ -26,8 +26,9 @@ main() {
// It's an error to have an empty map pattern.
switch (map) {
case {}:
// ^^
// [analyzer] COMPILE_TIME_ERROR.EMPTY_MAP_PATTERN
// ^^^^
// [analyzer] HINT.UNREACHABLE_SWITCH_CASE
// [cfe] unspecified
}
@@ -17,11 +17,11 @@ main() {
// Map patterns match even if there are extra keys.
Expect.equals(
'a',
'a b',
switch (map) {
{'a': _, 'b': _} => 'a b',
{'a': _} => 'a',
{'b': _} => 'b',
{'a': _, 'b': _} => 'a b',
_ => '???'
});
}