| 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 /// } | 427 /// } |
| 428 /// } | 428 /// } |
| 429 /// | 429 /// |
| 430 /// The order will be Derived.1, Base.1, Derived.2, Base.2, Derived.3; this | 430 /// The order will be Derived.1, Base.1, Derived.2, Base.2, Derived.3; this |
| 431 /// ordering preserves the invariant that code can't observe uninitialized | 431 /// ordering preserves the invariant that code can't observe uninitialized |
| 432 /// state, however it results in super constructor body not being run | 432 /// state, however it results in super constructor body not being run |
| 433 /// immediately after super initializers. Normally this isn't observable, but it | 433 /// immediately after super initializers. Normally this isn't observable, but it |
| 434 /// could be if initializers have side effects. | 434 /// could be if initializers have side effects. |
| 435 /// | 435 /// |
| 436 /// Better to have `super` at the end, as required by the Dart style guide: | 436 /// Better to have `super` at the end, as required by the Dart style guide: |
| 437 /// <http://goo.gl/q1T4BB> | 437 /// <https://goo.gl/EY6hDP> |
| 438 /// | 438 /// |
| 439 /// For now this is the only pattern we support. | 439 /// For now this is the only pattern we support. |
| 440 class InvalidSuperInvocation extends StaticError { | 440 class InvalidSuperInvocation extends StaticError { |
| 441 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node); | 441 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node); |
| 442 | 442 |
| 443 @override | 443 @override |
| 444 String get message => "super call must be last in an initializer " | 444 String get message => "super call must be last in an initializer " |
| 445 "list (see http://goo.gl/q1T4BB): {0}"; | 445 "list (see https://goo.gl/EY6hDP): {0}"; |
| 446 | 446 |
| 447 @override | 447 @override |
| 448 String get name => 'STRONG_MODE_INVALID_SUPER_INVOCATION'; | 448 String get name => 'STRONG_MODE_INVALID_SUPER_INVOCATION'; |
| 449 } | 449 } |
| 450 | 450 |
| 451 class InvalidVariableDeclaration extends StaticError { | 451 class InvalidVariableDeclaration extends StaticError { |
| 452 final DartType expectedType; | 452 final DartType expectedType; |
| 453 | 453 |
| 454 InvalidVariableDeclaration( | 454 InvalidVariableDeclaration( |
| 455 TypeSystem rules, AstNode declaration, this.expectedType) | 455 TypeSystem rules, AstNode declaration, this.expectedType) |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 // TODO(vsm,leafp): Remove this. | 578 // TODO(vsm,leafp): Remove this. |
| 579 class UninferredClosure extends DownCast { | 579 class UninferredClosure extends DownCast { |
| 580 UninferredClosure(TypeSystem rules, FunctionExpression expression, Cast cast) | 580 UninferredClosure(TypeSystem rules, FunctionExpression expression, Cast cast) |
| 581 : super._internal(rules, expression, cast); | 581 : super._internal(rules, expression, cast); |
| 582 | 582 |
| 583 @override | 583 @override |
| 584 String get name => 'STRONG_MODE_UNINFERRED_CLOSURE'; | 584 String get name => 'STRONG_MODE_UNINFERRED_CLOSURE'; |
| 585 | 585 |
| 586 toErrorCode() => new StaticTypeWarningCode(name, message); | 586 toErrorCode() => new StaticTypeWarningCode(name, message); |
| 587 } | 587 } |
| OLD | NEW |