| 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 library dev_compiler.src.info; | 7 library dev_compiler.src.info; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 325 |
| 326 toErrorCode() => new StaticTypeWarningCode(name, message); | 326 toErrorCode() => new StaticTypeWarningCode(name, message); |
| 327 } | 327 } |
| 328 | 328 |
| 329 // A down cast to a non-ground type. These behave differently from standard | 329 // A down cast to a non-ground type. These behave differently from standard |
| 330 // Dart and may be more likely to fail at runtime. | 330 // Dart and may be more likely to fail at runtime. |
| 331 class DownCastImplicit extends DownCast { | 331 class DownCastImplicit extends DownCast { |
| 332 DownCastImplicit(TypeRules rules, Expression expression, Cast cast) | 332 DownCastImplicit(TypeRules rules, Expression expression, Cast cast) |
| 333 : super._internal(rules, expression, cast); | 333 : super._internal(rules, expression, cast); |
| 334 | 334 |
| 335 toErrorCode() => new StaticTypeWarningCode(name, message); | 335 toErrorCode() => new HintCode(name, message); |
| 336 } | 336 } |
| 337 | 337 |
| 338 // An inferred type for the wrapped expression, which may need to be | 338 // An inferred type for the wrapped expression, which may need to be |
| 339 // reified into the term | 339 // reified into the term |
| 340 abstract class InferredTypeBase extends CoercionInfo { | 340 abstract class InferredTypeBase extends CoercionInfo { |
| 341 final DartType _type; | 341 final DartType _type; |
| 342 | 342 |
| 343 InferredTypeBase._internal(TypeRules rules, Expression expression, this._type) | 343 InferredTypeBase._internal(TypeRules rules, Expression expression, this._type) |
| 344 : super(rules, expression); | 344 : super(rules, expression); |
| 345 | 345 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 /// Better to have `super` at the end, as required by the Dart style guide: | 573 /// Better to have `super` at the end, as required by the Dart style guide: |
| 574 /// <http://goo.gl/q1T4BB> | 574 /// <http://goo.gl/q1T4BB> |
| 575 /// | 575 /// |
| 576 /// For now this is the only pattern we support. | 576 /// For now this is the only pattern we support. |
| 577 class InvalidSuperInvocation extends StaticError { | 577 class InvalidSuperInvocation extends StaticError { |
| 578 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node); | 578 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node); |
| 579 | 579 |
| 580 @override String get message => "super call must be last in an initializer " | 580 @override String get message => "super call must be last in an initializer " |
| 581 "list (see http://goo.gl/q1T4BB): {0}"; | 581 "list (see http://goo.gl/q1T4BB): {0}"; |
| 582 } | 582 } |
| OLD | NEW |