OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Regression test for issue 11891. | 5 // Test the use type arguments on constant maps. |
| 6 |
| 7 library map_literal11_test; |
6 | 8 |
7 import "package:expect/expect.dart"; | 9 import "package:expect/expect.dart"; |
8 import "mixin_prefix_lib.dart"; | |
9 | 10 |
10 class A extends Object with MixinClass { | 11 void foo(Map m) { |
11 String baz() => bar(); | 12 Expect.throws(() { m[23] = 23; }, (e) => e is TypeError); |
12 } | 13 } |
13 | 14 |
14 void main() { | 15 void main() { |
15 var a = new A(); | 16 Map<String, dynamic> map = {}; |
16 Expect.equals('{"a":1}', a.baz()); | 17 foo(map); |
17 } | 18 } |
OLD | NEW |