| 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 /// Encapsulates how to invoke the analyzer resolver and overrides how it | 5 /// Encapsulates how to invoke the analyzer resolver and overrides how it |
| 6 /// computes types on expressions to use our restricted set of types. | 6 /// computes types on expressions to use our restricted set of types. |
| 7 library dev_compiler.src.checker.resolver; | 7 library dev_compiler.src.checker.resolver; |
| 8 | 8 |
| 9 import 'package:analyzer/analyzer.dart'; | 9 import 'package:analyzer/analyzer.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| 11 import 'package:analyzer/src/generated/element.dart'; | 11 import 'package:analyzer/src/generated/element.dart'; |
| 12 import 'package:analyzer/src/generated/resolver.dart'; | 12 import 'package:analyzer/src/generated/resolver.dart'; |
| 13 import 'package:analyzer/src/generated/source.dart' show Source; | 13 import 'package:analyzer/src/generated/source.dart' show Source; |
| 14 import 'package:analyzer/src/generated/source_io.dart'; | 14 import 'package:analyzer/src/generated/source_io.dart'; |
| 15 import 'package:analyzer/src/generated/static_type_analyzer.dart'; | 15 import 'package:analyzer/src/generated/static_type_analyzer.dart'; |
| 16 import 'package:analyzer/src/generated/utilities_collection.dart' | 16 import 'package:analyzer/src/generated/utilities_collection.dart' |
| 17 show DirectedGraph; | 17 show DirectedGraph; |
| 18 import 'package:logging/logging.dart' as logger; | 18 import 'package:logging/logging.dart' as logger; |
| 19 | 19 |
| 20 import '../../strong_mode.dart' show StrongModeOptions; | 20 import '../../strong_mode.dart' show StrongModeOptions; |
| 21 import '../utils.dart'; | 21 import '../utils.dart'; |
| 22 import 'rules.dart'; |
| 22 | 23 |
| 23 final _log = new logger.Logger('dev_compiler.src.resolver'); | 24 final _log = new logger.Logger('dev_compiler.src.resolver'); |
| 24 | 25 |
| 25 /// A [LibraryResolver] that performs inference on top-levels and fields based | 26 /// A [LibraryResolver] that performs inference on top-levels and fields based |
| 26 /// on the value of the initializer, and on fields and methods based on | 27 /// on the value of the initializer, and on fields and methods based on |
| 27 /// overridden members in super classes. | 28 /// overridden members in super classes. |
| 28 class LibraryResolverWithInference extends LibraryResolver { | 29 class LibraryResolverWithInference extends LibraryResolver { |
| 29 final StrongModeOptions _options; | 30 final StrongModeOptions _options; |
| 30 | 31 |
| 31 LibraryResolverWithInference(context, this._options) : super(context); | 32 LibraryResolverWithInference(context, this._options) : super(context); |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 } | 748 } |
| 748 } | 749 } |
| 749 | 750 |
| 750 // Review note: no longer need to override visitFunctionExpression, this is | 751 // Review note: no longer need to override visitFunctionExpression, this is |
| 751 // handled by the analyzer internally. | 752 // handled by the analyzer internally. |
| 752 // TODO(vsm): in visitbinaryExpression: check computeStaticReturnType result? | 753 // TODO(vsm): in visitbinaryExpression: check computeStaticReturnType result? |
| 753 // TODO(vsm): in visitFunctionDeclaration: Should we ever use the expression | 754 // TODO(vsm): in visitFunctionDeclaration: Should we ever use the expression |
| 754 // type in a (...) => expr or just the written type? | 755 // type in a (...) => expr or just the written type? |
| 755 | 756 |
| 756 } | 757 } |
| OLD | NEW |