| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// General type checking tests | 5 /// General type checking tests |
| 6 library dev_compiler.test.checker_test; | 6 library dev_compiler.test.checker_test; |
| 7 | 7 |
| 8 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
| 9 | 9 |
| 10 import 'package:dev_compiler/src/testing.dart'; | 10 import '../testing.dart'; |
| 11 import '../test_util.dart' show testDirectory; | |
| 12 | 11 |
| 13 void main() { | 12 void main() { |
| 14 test('ternary operator', () { | 13 test('ternary operator', () { |
| 15 testChecker({ | 14 testChecker({ |
| 16 '/main.dart': ''' | 15 '/main.dart': ''' |
| 17 abstract class Comparable<T> { | 16 abstract class Comparable<T> { |
| 18 int compareTo(T other); | 17 int compareTo(T other); |
| 19 static int compare(Comparable a, Comparable b) => a.compareTo(b); | 18 static int compare(Comparable a, Comparable b) => a.compareTo(b); |
| 20 } | 19 } |
| 21 typedef int Comparator<T>(T a, T b); | 20 typedef int Comparator<T>(T a, T b); |
| (...skipping 2711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2733 | 2732 |
| 2734 baz1() sync* { yield* (/*info:DynamicCast*/x); } | 2733 baz1() sync* { yield* (/*info:DynamicCast*/x); } |
| 2735 Iterable baz2() sync* { yield* (/*info:DynamicCast*/x); } | 2734 Iterable baz2() sync* { yield* (/*info:DynamicCast*/x); } |
| 2736 Iterable<int> baz3() sync* { yield* (/*warning:DownCastComposite*/x); } | 2735 Iterable<int> baz3() sync* { yield* (/*warning:DownCastComposite*/x); } |
| 2737 Iterable<int> baz4() sync* { yield* new Iterable<int>(); } | 2736 Iterable<int> baz4() sync* { yield* new Iterable<int>(); } |
| 2738 Iterable<int> baz5() sync* { yield* (/*info:InferredTypeAllocation*/new
Iterable()); } | 2737 Iterable<int> baz5() sync* { yield* (/*info:InferredTypeAllocation*/new
Iterable()); } |
| 2739 ''' | 2738 ''' |
| 2740 })); | 2739 })); |
| 2741 }); | 2740 }); |
| 2742 } | 2741 } |
| OLD | NEW |