| Index: pkg/analyzer/lib/src/generated/resolver.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
|
| index 74232cdf993c07d51b10b7be7e677f908db92be6..4170c00569eabdebaf09c571bbf714692674bc0f 100644
|
| --- a/pkg/analyzer/lib/src/generated/resolver.dart
|
| +++ b/pkg/analyzer/lib/src/generated/resolver.dart
|
| @@ -24,6 +24,7 @@ import 'package:analyzer/src/dart/element/type.dart';
|
| import 'package:analyzer/src/dart/resolver/inheritance_manager.dart';
|
| import 'package:analyzer/src/dart/resolver/scope.dart';
|
| import 'package:analyzer/src/error/codes.dart';
|
| +import 'package:analyzer/src/fasta/uri_instrumentation.dart';
|
| import 'package:analyzer/src/generated/constant.dart';
|
| import 'package:analyzer/src/generated/element_resolver.dart';
|
| import 'package:analyzer/src/generated/engine.dart';
|
| @@ -4211,6 +4212,11 @@ class InferenceContext {
|
| final ErrorReporter _errorReporter;
|
|
|
| /**
|
| + * The instrumentation to report inference information.
|
| + */
|
| + final UriInstrumentation _instrumentation;
|
| +
|
| + /**
|
| * If true, emit hints when types are inferred
|
| */
|
| final bool _inferenceHints;
|
| @@ -4239,8 +4245,8 @@ class InferenceContext {
|
| */
|
| final List<DartType> _returnStack = <DartType>[];
|
|
|
| - InferenceContext._(this._errorReporter, TypeProvider typeProvider,
|
| - this._typeSystem, this._inferenceHints)
|
| + InferenceContext._(TypeProvider typeProvider, this._typeSystem,
|
| + this._inferenceHints, this._errorReporter, this._instrumentation)
|
| : _typeProvider = typeProvider;
|
|
|
| /**
|
| @@ -4304,6 +4310,8 @@ class InferenceContext {
|
| * [type] has been inferred as the type of [node].
|
| */
|
| void recordInference(Expression node, DartType type) {
|
| + _instrumentation?.recordInference(node.offset, type);
|
| +
|
| if (!_inferenceHints) {
|
| return;
|
| }
|
| @@ -4992,6 +5000,11 @@ class ResolverVisitor extends ScopedVisitor {
|
| TypeSystem typeSystem;
|
|
|
| /**
|
| + * The instrumentation to report inference information.
|
| + */
|
| + final UriInstrumentation instrumentation;
|
| +
|
| + /**
|
| * The class declaration representing the class containing the current node, or `null` if
|
| * the current node is not contained in a class.
|
| */
|
| @@ -5060,7 +5073,7 @@ class ResolverVisitor extends ScopedVisitor {
|
| */
|
| ResolverVisitor(LibraryElement definingLibrary, Source source,
|
| TypeProvider typeProvider, AnalysisErrorListener errorListener,
|
| - {Scope nameScope})
|
| + {Scope nameScope, this.instrumentation})
|
| : super(definingLibrary, source, typeProvider, errorListener,
|
| nameScope: nameScope) {
|
| AnalysisOptions options = definingLibrary.context.analysisOptions;
|
| @@ -5071,8 +5084,8 @@ class ResolverVisitor extends ScopedVisitor {
|
| if (options is AnalysisOptionsImpl) {
|
| strongModeHints = options.strongModeHints;
|
| }
|
| - this.inferenceContext = new InferenceContext._(
|
| - errorReporter, typeProvider, typeSystem, strongModeHints);
|
| + this.inferenceContext = new InferenceContext._(typeProvider, typeSystem,
|
| + strongModeHints, errorReporter, instrumentation);
|
| this.typeAnalyzer = new StaticTypeAnalyzer(this);
|
| }
|
|
|
|
|