| Index: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
|
| index bc24dcea0830f92471b7f1c0f20bf8de172c3fbd..b7fc20688edb94a371bcabb89d8b83f0fb15c2a6 100644
|
| --- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
|
| +++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
|
| @@ -23,11 +23,14 @@ abstract class TypeInferrer<S, E, V, F> {
|
|
|
| final Instrumentation instrumentation;
|
|
|
| + final bool strongMode;
|
| +
|
| /// The URI of the code for which type inference is currently being
|
| /// performed--this is used for testing.
|
| Uri uri;
|
|
|
| - TypeInferrer(this.coreTypes, this.classHierarchy, this.instrumentation);
|
| + TypeInferrer(this.coreTypes, this.classHierarchy, this.instrumentation,
|
| + this.strongMode);
|
|
|
| /// Performs type inference on a method with the given method [body].
|
| ///
|
| @@ -75,7 +78,7 @@ abstract class TypeInferrer<S, E, V, F> {
|
| if (initializer == null) return;
|
| var inferredType =
|
| inferExpression(initializer, declaredType, declaredType == null);
|
| - if (declaredType == null) {
|
| + if (strongMode && declaredType == null) {
|
| instrumentation?.record(
|
| 'type', uri, offset, new InstrumentationValueForType(inferredType));
|
| setType(inferredType);
|
|
|