Chromium Code Reviews| 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 // TODO(jmesserly): this file needs to be refactored, it's a port from | 5 // TODO(jmesserly): this file needs to be refactored, it's a port from |
| 6 // package:dev_compiler's tests | 6 // package:dev_compiler's tests |
| 7 /// General type checking tests | 7 /// General type checking tests |
| 8 library test.src.task.strong.checker_test; | 8 library test.src.task.strong.checker_test; |
| 9 | 9 |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 977 lOfOs = mOfAs; | 977 lOfOs = mOfAs; |
| 978 lOfOs = lOfDs; | 978 lOfOs = lOfDs; |
| 979 lOfOs = lOfOs; | 979 lOfOs = lOfOs; |
| 980 lOfOs = lOfAs; | 980 lOfOs = lOfAs; |
| 981 } | 981 } |
| 982 { | 982 { |
| 983 lOfAs = /*warning:DownCastComposite*/mOfDs; | 983 lOfAs = /*warning:DownCastComposite*/mOfDs; |
| 984 lOfAs = /*severe:StaticTypeError*/mOfOs; | 984 lOfAs = /*severe:StaticTypeError*/mOfOs; |
| 985 lOfAs = mOfAs; | 985 lOfAs = mOfAs; |
| 986 lOfAs = /*warning:DownCastComposite*/lOfDs; | 986 lOfAs = /*warning:DownCastComposite*/lOfDs; |
| 987 lOfAs = /*warning:DownCastComposite*/lOfOs; | 987 lOfAs = /*info:DownCastImplicit*/lOfOs; |
| 988 lOfAs = lOfAs; | 988 lOfAs = lOfAs; |
| 989 } | 989 } |
| 990 { | 990 { |
| 991 mOfDs = mOfDs; | 991 mOfDs = mOfDs; |
| 992 mOfDs = mOfOs; | 992 mOfDs = mOfOs; |
| 993 mOfDs = mOfAs; | 993 mOfDs = mOfAs; |
| 994 mOfDs = /*info:DownCastImplicit*/lOfDs; | 994 mOfDs = /*info:DownCastImplicit*/lOfDs; |
| 995 mOfDs = /*info:DownCastImplicit*/lOfOs; | 995 mOfDs = /*info:DownCastImplicit*/lOfOs; |
| 996 mOfDs = /*info:DownCastImplicit*/lOfAs; | 996 mOfDs = /*warning:DownCastComposite*/lOfAs; |
|
vsm
2015/10/20 22:05:05
This is the case where we now complain more loudly
| |
| 997 } | 997 } |
| 998 { | 998 { |
| 999 mOfOs = mOfDs; | 999 mOfOs = mOfDs; |
| 1000 mOfOs = mOfOs; | 1000 mOfOs = mOfOs; |
| 1001 mOfOs = mOfAs; | 1001 mOfOs = mOfAs; |
| 1002 mOfOs = /*info:DownCastImplicit*/lOfDs; | 1002 mOfOs = /*info:DownCastImplicit*/lOfDs; |
| 1003 mOfOs = /*info:DownCastImplicit*/lOfOs; | 1003 mOfOs = /*info:DownCastImplicit*/lOfOs; |
| 1004 mOfOs = /*severe:StaticTypeError*/lOfAs; | 1004 mOfOs = /*severe:StaticTypeError*/lOfAs; |
| 1005 } | 1005 } |
| 1006 { | 1006 { |
| 1007 mOfAs = /*warning:DownCastComposite*/mOfDs; | 1007 mOfAs = /*warning:DownCastComposite*/mOfDs; |
| 1008 mOfAs = /*warning:DownCastComposite*/mOfOs; | 1008 mOfAs = /*info:DownCastImplicit*/mOfOs; |
| 1009 mOfAs = mOfAs; | 1009 mOfAs = mOfAs; |
| 1010 mOfAs = /*warning:DownCastComposite*/lOfDs; | 1010 mOfAs = /*warning:DownCastComposite*/lOfDs; |
| 1011 mOfAs = /*warning:DownCastComposite*/lOfOs; | 1011 mOfAs = /*info:DownCastImplicit*/lOfOs; |
| 1012 mOfAs = /*warning:DownCastComposite*/lOfAs; | 1012 mOfAs = /*info:DownCastImplicit*/lOfAs; |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 } | 1015 } |
| 1016 ''' | 1016 ''' |
| 1017 }); | 1017 }); |
| 1018 | 1018 |
| 1019 testChecker('Type checking literals', { | 1019 testChecker('Type checking literals', { |
| 1020 '/main.dart': ''' | 1020 '/main.dart': ''' |
| 1021 test() { | 1021 test() { |
| 1022 num n = 3; | 1022 num n = 3; |
| (...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2302 | 2302 |
| 2303 baz1() sync* { yield* (/*info:DynamicCast*/x); } | 2303 baz1() sync* { yield* (/*info:DynamicCast*/x); } |
| 2304 Iterable baz2() sync* { yield* (/*info:DynamicCast*/x); } | 2304 Iterable baz2() sync* { yield* (/*info:DynamicCast*/x); } |
| 2305 Iterable<int> baz3() sync* { yield* (/*warning:DownCastComposite*/x); } | 2305 Iterable<int> baz3() sync* { yield* (/*warning:DownCastComposite*/x); } |
| 2306 Iterable<int> baz4() sync* { yield* new Iterable<int>(); } | 2306 Iterable<int> baz4() sync* { yield* new Iterable<int>(); } |
| 2307 Iterable<int> baz5() sync* { yield* (/*info:InferredTypeAllocation*/new Iterable()); } | 2307 Iterable<int> baz5() sync* { yield* (/*info:InferredTypeAllocation*/new Iterable()); } |
| 2308 ''' | 2308 ''' |
| 2309 }); | 2309 }); |
| 2310 }); | 2310 }); |
| 2311 } | 2311 } |
| OLD | NEW |