diff --git a/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart b/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart index eb43608f4e7..a842f66e01f 100644 --- a/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart +++ b/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart @@ -59,9 +59,6 @@ class GenericInferrer { /// The list of type parameters being inferred. final List _typeFormals; - /// Indicates whether type parameter bounds should be included in constraints. - final bool considerExtendsClause; - /// The [ErrorReporter] to which inference errors should be reported, or /// `null` if errors shouldn't be reported. final ErrorReporter? errorReporter; @@ -75,8 +72,7 @@ class GenericInferrer { final bool genericMetadataIsEnabled; GenericInferrer(this._typeSystem, this._typeFormals, - {this.considerExtendsClause = true, - this.errorReporter, + {this.errorReporter, this.errorNode, required this.genericMetadataIsEnabled}) { if (errorReporter != null) { @@ -438,7 +434,7 @@ class GenericInferrer { var typeParam = _typeFormals[i] as TypeParameterElementImpl; _TypeConstraint? extendsClause; var bound = typeParam.bound; - if (considerExtendsClause && bound != null) { + if (bound != null) { extendsClause = _TypeConstraint.fromExtends( typeParam, bound, diff --git a/pkg/analyzer/lib/src/dart/element/type_system.dart b/pkg/analyzer/lib/src/dart/element/type_system.dart index 10f80f75a20..e782c15dffc 100644 --- a/pkg/analyzer/lib/src/dart/element/type_system.dart +++ b/pkg/analyzer/lib/src/dart/element/type_system.dart @@ -1219,7 +1219,6 @@ class TypeSystemImpl implements TypeSystem { }) { var typeParameters = mixinElement.typeParameters; var inferrer = GenericInferrer(this, typeParameters, - considerExtendsClause: false, genericMetadataIsEnabled: genericMetadataIsEnabled); for (int i = 0; i < srcTypes.length; i++) { inferrer.constrainReturnType(srcTypes[i], destTypes[i]);