| Index: pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
|
| index 16beabb7bf8e4b37d3da6afa9aebed4077fb3836..1c1b7a20dacb1d5a76a885ed0afa45fc46347903 100644
|
| --- a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
|
| +++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
|
| @@ -36,13 +36,13 @@ class TypeConstraint {
|
| }
|
|
|
| class TypeSchemaEnvironment extends TypeEnvironment {
|
| + @override
|
| + final bool strongMode;
|
| +
|
| TypeSchemaEnvironment(
|
| CoreTypes coreTypes, ClassHierarchy hierarchy, this.strongMode)
|
| : super(coreTypes, hierarchy);
|
|
|
| - @override
|
| - final bool strongMode;
|
| -
|
| /// Modify the given [constraint]'s lower bound to include [lower].
|
| void addLowerBound(TypeConstraint constraint, DartType lower) {
|
| constraint.lower = getLeastUpperBound(constraint.lower, lower);
|
| @@ -226,13 +226,6 @@ class TypeSchemaEnvironment extends TypeEnvironment {
|
| List<DartType> actualTypes,
|
| DartType returnContextType,
|
| List<DartType> inferredTypes) {
|
| - if (returnContextType is DynamicType) {
|
| - // Analyzer treats a type context of `dynamic` as equivalent to an empty
|
| - // context. TODO(paulberry): this is not spec'ed anywhere; do we still
|
| - // want to do this?
|
| - returnContextType = null;
|
| - }
|
| -
|
| if (typeParametersToInfer.isEmpty) {
|
| return;
|
| }
|
| @@ -243,7 +236,7 @@ class TypeSchemaEnvironment extends TypeEnvironment {
|
| // are implied by this.
|
| var gatherer = new TypeConstraintGatherer(this, typeParametersToInfer);
|
|
|
| - if (returnContextType != null) {
|
| + if (!isEmptyContext(returnContextType)) {
|
| gatherer.trySubtypeMatch(declaredReturnType, returnContextType);
|
| }
|
|
|
| @@ -396,6 +389,16 @@ class TypeSchemaEnvironment extends TypeEnvironment {
|
| }
|
| }
|
|
|
| + bool isEmptyContext(DartType context) {
|
| + if (context is DynamicType) {
|
| + // Analyzer treats a type context of `dynamic` as equivalent to an empty
|
| + // context. TODO(paulberry): this is not spec'ed anywhere; do we still
|
| + // want to do this?
|
| + return true;
|
| + }
|
| + return context == null;
|
| + }
|
| +
|
| @override
|
| bool isTop(DartType t) {
|
| if (t is UnknownType) {
|
|
|