OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // A regression test for a dart2js crash. | 5 // A regression test for a dart2js crash. |
| 6 library type.argument.factory.nocrash.test; |
| 7 import 'dart:collection' show LinkedHashMap; |
6 | 8 |
7 void main() { | 9 void main() { |
8 // This constructor call causes a crash in dart2js. | 10 // This constructor call causes a crash in dart2js. |
9 var o = new LinkedHashMap<int, int>(); | 11 var o = new LinkedHashMap<int, int>(); |
10 | 12 |
11 // Comment out this line, the compiler doesn't crash. | 13 // Comment out this line, the compiler doesn't crash. |
12 Expect.isFalse(o is List<int>); | 14 Expect.isFalse(o is List<int>); |
13 | 15 |
14 // Enable these two lines, the compiler doesn't crash. | 16 // Enable these two lines, the compiler doesn't crash. |
15 Expect.isTrue(o.keys is Iterable<int>); | 17 Expect.isTrue(o.keys is Iterable<int>); |
16 Expect.isFalse(o.keys is Iterable<String>); | 18 Expect.isFalse(o.keys is Iterable<String>); |
17 } | 19 } |
OLD | NEW |