| 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:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 9 | 9 |
| 10 import 'package:dev_compiler/src/testing.dart'; | 10 import 'package:dev_compiler/src/testing.dart'; |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1496 | 1496 |
| 1497 List<int> l2 = /*warning:InferableLiteral*/[1, 2, 3]; | 1497 List<int> l2 = /*warning:InferableLiteral*/[1, 2, 3]; |
| 1498 l2 = /*warning:DownCastComposite*/i1; | 1498 l2 = /*warning:DownCastComposite*/i1; |
| 1499 l2 = /*warning:DownCastComposite*/l1; | 1499 l2 = /*warning:DownCastComposite*/l1; |
| 1500 | 1500 |
| 1501 l2 = /*warning:InferableAllocation*/new List(); | 1501 l2 = /*warning:InferableAllocation*/new List(); |
| 1502 l2 = /*warning:InferableAllocation*/new List(10); | 1502 l2 = /*warning:InferableAllocation*/new List(10); |
| 1503 l2 = /*warning:InferableAllocation*/new List.filled(10, 42); | 1503 l2 = /*warning:InferableAllocation*/new List.filled(10, 42); |
| 1504 } | 1504 } |
| 1505 ''' | 1505 ''' |
| 1506 }); | 1506 }, inferDownwards: false); |
| 1507 }); | 1507 }); |
| 1508 | 1508 |
| 1509 test('Type checking literals', () { | 1509 test('Type checking literals', () { |
| 1510 testChecker({ | 1510 testChecker({ |
| 1511 '/main.dart': ''' | 1511 '/main.dart': ''' |
| 1512 test() { | 1512 test() { |
| 1513 num n = 3; | 1513 num n = 3; |
| 1514 int i = 3; | 1514 int i = 3; |
| 1515 String s = "hello"; | 1515 String s = "hello"; |
| 1516 { | 1516 { |
| (...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2800 f = bar as II2D; | 2800 f = bar as II2D; |
| 2801 f = bar as DD2I; | 2801 f = bar as DD2I; |
| 2802 f = bar as DI2D; | 2802 f = bar as DI2D; |
| 2803 f = bar as ID2D; | 2803 f = bar as ID2D; |
| 2804 f = bar as DD2D; | 2804 f = bar as DD2D; |
| 2805 } | 2805 } |
| 2806 ''' | 2806 ''' |
| 2807 }); | 2807 }); |
| 2808 }); | 2808 }); |
| 2809 } | 2809 } |
| OLD | NEW |