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 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be | 5 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be |
6 // refactored to fit into analyzer. | 6 // refactored to fit into analyzer. |
7 library analyzer.src.task.strong.checker; | 7 library analyzer.src.task.strong.checker; |
8 | 8 |
9 import 'package:analyzer/analyzer.dart'; | 9 import 'package:analyzer/analyzer.dart'; |
| 10 import 'package:analyzer/dart/ast/ast.dart'; |
| 11 import 'package:analyzer/dart/ast/visitor.dart'; |
10 import 'package:analyzer/dart/element/element.dart'; | 12 import 'package:analyzer/dart/element/element.dart'; |
11 import 'package:analyzer/dart/element/type.dart'; | 13 import 'package:analyzer/dart/element/type.dart'; |
12 import 'package:analyzer/src/dart/element/type.dart'; | 14 import 'package:analyzer/src/dart/element/type.dart'; |
13 import 'package:analyzer/src/generated/ast.dart'; | |
14 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; | 15 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; |
15 import 'package:analyzer/src/generated/scanner.dart' show Token, TokenType; | 16 import 'package:analyzer/src/generated/scanner.dart' show Token, TokenType; |
16 import 'package:analyzer/src/generated/type_system.dart'; | 17 import 'package:analyzer/src/generated/type_system.dart'; |
17 | 18 |
18 import 'info.dart'; | 19 import 'info.dart'; |
19 | 20 |
20 DartType _elementType(Element e) { | 21 DartType _elementType(Element e) { |
21 if (e == null) { | 22 if (e == null) { |
22 // Malformed code - just return dynamic. | 23 // Malformed code - just return dynamic. |
23 return DynamicTypeImpl.instance; | 24 return DynamicTypeImpl.instance; |
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 } while (!current.isObject && !visited.contains(current)); | 1238 } while (!current.isObject && !visited.contains(current)); |
1238 } | 1239 } |
1239 | 1240 |
1240 void _recordMessage(StaticInfo info) { | 1241 void _recordMessage(StaticInfo info) { |
1241 if (info == null) return; | 1242 if (info == null) return; |
1242 var error = info.toAnalysisError(); | 1243 var error = info.toAnalysisError(); |
1243 if (error.errorCode.errorSeverity == ErrorSeverity.ERROR) _failure = true; | 1244 if (error.errorCode.errorSeverity == ErrorSeverity.ERROR) _failure = true; |
1244 _reporter.onError(error); | 1245 _reporter.onError(error); |
1245 } | 1246 } |
1246 } | 1247 } |
OLD | NEW |