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 library dev_compiler.src.checker.checker; | 5 library dev_compiler.src.checker.checker; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
9 import 'package:analyzer/src/generated/element.dart'; | 9 import 'package:analyzer/src/generated/element.dart'; |
10 import 'package:analyzer/src/generated/scanner.dart' show Token, TokenType; | 10 import 'package:analyzer/src/generated/scanner.dart' show Token, TokenType; |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 DynamicInvoke.set(target, true); | 994 DynamicInvoke.set(target, true); |
995 } | 995 } |
996 | 996 |
997 void _recordMessage(StaticInfo info) { | 997 void _recordMessage(StaticInfo info) { |
998 if (info == null) return; | 998 if (info == null) return; |
999 var error = info.toAnalysisError(); | 999 var error = info.toAnalysisError(); |
1000 if (error.errorCode.errorSeverity == ErrorSeverity.ERROR) _failure = true; | 1000 if (error.errorCode.errorSeverity == ErrorSeverity.ERROR) _failure = true; |
1001 reporter.onError(error); | 1001 reporter.onError(error); |
1002 | 1002 |
1003 if (info is CoercionInfo) { | 1003 if (info is CoercionInfo) { |
1004 assert(CoercionInfo.get(info.node) == null); | 1004 // TODO(jmesserly): if we're run again on the same AST, we'll produce the |
| 1005 // same annotations. This should be harmless. This might go away once |
| 1006 // CodeChecker is integrated better with analyzer, as it will know that |
| 1007 // checking has already been performed. |
| 1008 // assert(CoercionInfo.get(info.node) == null); |
1005 CoercionInfo.set(info.node, info); | 1009 CoercionInfo.set(info.node, info); |
1006 } | 1010 } |
1007 } | 1011 } |
1008 } | 1012 } |
OLD | NEW |