| 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 toErrorCode() => new CompileTimeErrorCode(name, message); | 462 toErrorCode() => new CompileTimeErrorCode(name, message); |
| 463 } | 463 } |
| 464 | 464 |
| 465 // TODO(jmesserly): this could use some refactoring. These are essentially | 465 // TODO(jmesserly): this could use some refactoring. These are essentially |
| 466 // like ErrorCodes in analyzer, but we're including some details in our message. | 466 // like ErrorCodes in analyzer, but we're including some details in our message. |
| 467 // Analyzer instead has template strings, and replaces '{0}' with the first | 467 // Analyzer instead has template strings, and replaces '{0}' with the first |
| 468 // argument. | 468 // argument. |
| 469 abstract class StaticInfo { | 469 abstract class StaticInfo { |
| 470 /// Strong-mode error code names. | 470 /// Strong-mode error code names. |
| 471 /// | 471 /// |
| 472 /// Used for error code configuration validation in `.analysis_options`. | 472 /// Used for error code configuration validation in an analysis options file. |
| 473 static const List<String> names = const [ | 473 static const List<String> names = const [ |
| 474 // | 474 // |
| 475 // Manually populated. | 475 // Manually populated. |
| 476 // | 476 // |
| 477 'STRONG_MODE_ASSIGNMENT_CAST', | 477 'STRONG_MODE_ASSIGNMENT_CAST', |
| 478 'STRONG_MODE_DOWN_CAST_COMPOSITE', | 478 'STRONG_MODE_DOWN_CAST_COMPOSITE', |
| 479 'STRONG_MODE_DOWN_CAST_IMPLICIT', | 479 'STRONG_MODE_DOWN_CAST_IMPLICIT', |
| 480 'STRONG_MODE_DYNAMIC_CAST', | 480 'STRONG_MODE_DYNAMIC_CAST', |
| 481 'STRONG_MODE_DYNAMIC_INVOKE', | 481 'STRONG_MODE_DYNAMIC_INVOKE', |
| 482 'STRONG_MODE_INFERRED_TYPE', | 482 'STRONG_MODE_INFERRED_TYPE', |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 super(expression); | 538 super(expression); |
| 539 | 539 |
| 540 @override | 540 @override |
| 541 List<Object> get arguments => [node, baseType, expectedType]; | 541 List<Object> get arguments => [node, baseType, expectedType]; |
| 542 @override | 542 @override |
| 543 String get message => 'Type check failed: {0} ({1}) is not of type {2}'; | 543 String get message => 'Type check failed: {0} ({1}) is not of type {2}'; |
| 544 | 544 |
| 545 @override | 545 @override |
| 546 String get name => 'STRONG_MODE_STATIC_TYPE_ERROR'; | 546 String get name => 'STRONG_MODE_STATIC_TYPE_ERROR'; |
| 547 } | 547 } |
| OLD | NEW |