| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 class DownCastImplicit extends DownCast { | 196 class DownCastImplicit extends DownCast { |
| 197 DownCastImplicit(TypeRules rules, Expression expression, Cast cast) | 197 DownCastImplicit(TypeRules rules, Expression expression, Cast cast) |
| 198 : super._internal(rules, expression, cast); | 198 : super._internal(rules, expression, cast); |
| 199 | 199 |
| 200 @override | 200 @override |
| 201 String get name => 'STRONG_MODE_DOWN_CAST_IMPLICIT'; | 201 String get name => 'STRONG_MODE_DOWN_CAST_IMPLICIT'; |
| 202 | 202 |
| 203 toErrorCode() => new HintCode(name, message); | 203 toErrorCode() => new HintCode(name, message); |
| 204 } | 204 } |
| 205 | 205 |
| 206 // | |
| 207 // Standard down casts. These casts are implicitly injected by the compiler. | |
| 208 // | |
| 209 | |
| 210 // A down cast from dynamic to T. | 206 // A down cast from dynamic to T. |
| 211 class DynamicCast extends DownCast { | 207 class DynamicCast extends DownCast { |
| 212 DynamicCast(TypeRules rules, Expression expression, Cast cast) | 208 DynamicCast(TypeRules rules, Expression expression, Cast cast) |
| 213 : super._internal(rules, expression, cast); | 209 : super._internal(rules, expression, cast); |
| 214 | 210 |
| 215 @override | 211 @override |
| 216 String get name => 'STRONG_MODE_DYNAMIC_CAST'; | 212 String get name => 'STRONG_MODE_DYNAMIC_CAST'; |
| 217 | 213 |
| 218 toErrorCode() => new HintCode(name, message); | 214 toErrorCode() => new HintCode(name, message); |
| 219 } | 215 } |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 // TODO(vsm,leafp): Remove this. | 533 // TODO(vsm,leafp): Remove this. |
| 538 class UninferredClosure extends DownCast { | 534 class UninferredClosure extends DownCast { |
| 539 UninferredClosure(TypeRules rules, FunctionExpression expression, Cast cast) | 535 UninferredClosure(TypeRules rules, FunctionExpression expression, Cast cast) |
| 540 : super._internal(rules, expression, cast); | 536 : super._internal(rules, expression, cast); |
| 541 | 537 |
| 542 @override | 538 @override |
| 543 String get name => 'STRONG_MODE_UNINFERRED_CLOSURE'; | 539 String get name => 'STRONG_MODE_UNINFERRED_CLOSURE'; |
| 544 | 540 |
| 545 toErrorCode() => new StaticTypeWarningCode(name, message); | 541 toErrorCode() => new StaticTypeWarningCode(name, message); |
| 546 } | 542 } |
| OLD | NEW |