| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 // Invalid override due to incompatible type. I.e., the overridden signature | 428 // Invalid override due to incompatible type. I.e., the overridden signature |
| 429 // is not compatible with the original. | 429 // is not compatible with the original. |
| 430 class InvalidMethodOverride extends InvalidOverride { | 430 class InvalidMethodOverride extends InvalidOverride { |
| 431 InvalidMethodOverride(AstNode node, ExecutableElement element, | 431 InvalidMethodOverride(AstNode node, ExecutableElement element, |
| 432 InterfaceType base, FunctionType subType, FunctionType baseType) | 432 InterfaceType base, FunctionType subType, FunctionType baseType) |
| 433 : super(node, element, base, subType, baseType); | 433 : super(node, element, base, subType, baseType); |
| 434 | 434 |
| 435 String get message => _messageHelper('Invalid override'); | 435 String get message => _messageHelper('Invalid override'); |
| 436 } | 436 } |
| 437 | 437 |
| 438 /// Used to mark unexpected situations in our compiler were we couldn't compute | |
| 439 /// the type of an expression. | |
| 440 // TODO(sigmund): This is normally a result of another error that is caught by | |
| 441 // the analyzer, so this should likely be removed in the future. | |
| 442 class MissingTypeError extends StaticInfo { | |
| 443 final AstNode node; | |
| 444 toErrorCode() => new StaticTypeWarningCode(name, message); | |
| 445 | |
| 446 MissingTypeError(this.node); | |
| 447 | |
| 448 @override List<Object> get arguments => [node, node.runtimeType]; | |
| 449 String get message => "type analysis didn't compute the type of: {0} {1}"; | |
| 450 } | |
| 451 | |
| 452 /// Dart constructors have one weird quirk, illustrated with this example: | 438 /// Dart constructors have one weird quirk, illustrated with this example: |
| 453 /// | 439 /// |
| 454 /// class Base { | 440 /// class Base { |
| 455 /// var x; | 441 /// var x; |
| 456 /// Base() : x = print('Base.1') { | 442 /// Base() : x = print('Base.1') { |
| 457 /// print('Base.2'); | 443 /// print('Base.2'); |
| 458 /// } | 444 /// } |
| 459 /// } | 445 /// } |
| 460 /// | 446 /// |
| 461 /// class Derived extends Base { | 447 /// class Derived extends Base { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 477 /// Better to have `super` at the end, as required by the Dart style guide: | 463 /// Better to have `super` at the end, as required by the Dart style guide: |
| 478 /// <http://goo.gl/q1T4BB> | 464 /// <http://goo.gl/q1T4BB> |
| 479 /// | 465 /// |
| 480 /// For now this is the only pattern we support. | 466 /// For now this is the only pattern we support. |
| 481 class InvalidSuperInvocation extends StaticError { | 467 class InvalidSuperInvocation extends StaticError { |
| 482 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node); | 468 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node); |
| 483 | 469 |
| 484 @override String get message => "super call must be last in an initializer " | 470 @override String get message => "super call must be last in an initializer " |
| 485 "list (see http://goo.gl/q1T4BB): {0}"; | 471 "list (see http://goo.gl/q1T4BB): {0}"; |
| 486 } | 472 } |
| OLD | NEW |