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:
committed by
Commit Queue
parent
f1007d4aa2
commit
e2520f88ef
@@ -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',
|
||||
_ => '???'
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user