Skip to content

Commit e6daaad

Browse files
authored
Fixes #1703. wildcards_A01_t02.dart. Don't use wildcard as a map key (#1729)
1 parent c8a1e24 commit e6daaad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

LanguageFeatures/Patterns/wildcards_A01_t02.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ main() {
6161
Expect.equals(4, __);
6262

6363
var map2 = {"1": 2, "3": 4};
64-
var {"1": _, _: num ___} = map2;
64+
var {"1": _, "3": num ___} = map2;
6565
Expect.equals(4, ___);
6666

67+
dynamic map3 = map2;
6768
Expect.throws(() {
68-
var {"1": String _, "3": num _} = map2;
69+
var {"1": String _, "3": num _} = map3;
6970
});
7071
Expect.throws(() {
71-
var {"1": _, "3": String _} = map2;
72+
var {"1": _, "3": String _} = map3;
7273
});
7374
Expect.equals("{1, _}", test1({1: 2, 2: 1}));
7475
Expect.equals("{1, _}", test1({1: 3, 42: ""}));

0 commit comments

Comments
 (0)