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 /// Defines static information collected by the type checker and used later by | 5 /// Defines static information collected by the type checker and used later by |
6 /// emitters to generate code. | 6 /// emitters to generate code. |
7 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be | 7 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be |
8 // refactored to fit into analyzer. | 8 // refactored to fit into analyzer. |
9 library analyzer.src.task.strong.info; | 9 library analyzer.src.task.strong.info; |
10 | 10 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 /// A down cast to a non-ground type. These behave differently from standard | 163 /// A down cast to a non-ground type. These behave differently from standard |
164 /// Dart and may be more likely to fail at runtime. | 164 /// Dart and may be more likely to fail at runtime. |
165 class DownCastComposite extends DownCast { | 165 class DownCastComposite extends DownCast { |
166 DownCastComposite(TypeSystem rules, Expression expression, DartType fromType, | 166 DownCastComposite(TypeSystem rules, Expression expression, DartType fromType, |
167 DartType toType) | 167 DartType toType) |
168 : super._internal(rules, expression, fromType, toType); | 168 : super._internal(rules, expression, fromType, toType); |
169 | 169 |
170 @override | 170 @override |
171 String get name => 'STRONG_MODE_DOWN_CAST_COMPOSITE'; | 171 String get name => 'STRONG_MODE_DOWN_CAST_COMPOSITE'; |
172 | 172 |
173 toErrorCode() => new StaticTypeWarningCode(name, message); | 173 toErrorCode() => new StaticWarningCode(name, message); |
174 } | 174 } |
175 | 175 |
176 /// A down cast to a non-ground type. These behave differently from standard | 176 /// A down cast to a non-ground type. These behave differently from standard |
177 /// Dart and may be more likely to fail at runtime. | 177 /// Dart and may be more likely to fail at runtime. |
178 class DownCastImplicit extends DownCast { | 178 class DownCastImplicit extends DownCast { |
179 DownCastImplicit(TypeSystem rules, Expression expression, DartType fromType, | 179 DownCastImplicit(TypeSystem rules, Expression expression, DartType fromType, |
180 DartType toType) | 180 DartType toType) |
181 : super._internal(rules, expression, fromType, toType); | 181 : super._internal(rules, expression, fromType, toType); |
182 | 182 |
183 @override | 183 @override |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 super(expression); | 539 super(expression); |
540 | 540 |
541 @override | 541 @override |
542 List<Object> get arguments => [node, baseType, expectedType]; | 542 List<Object> get arguments => [node, baseType, expectedType]; |
543 @override | 543 @override |
544 String get message => 'Type check failed: {0} ({1}) is not of type {2}'; | 544 String get message => 'Type check failed: {0} ({1}) is not of type {2}'; |
545 | 545 |
546 @override | 546 @override |
547 String get name => 'STRONG_MODE_STATIC_TYPE_ERROR'; | 547 String get name => 'STRONG_MODE_STATIC_TYPE_ERROR'; |
548 } | 548 } |
OLD | NEW |