Remove unused parameters from relateTypeFormals().
Change-Id: Ibf128256fb243d97c962cf661f7261f8796b665f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234915
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart b/pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart
index fdabfea..7e5b176 100644
--- a/pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart
+++ b/pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart
@@ -274,7 +274,7 @@
// The bounds of type parameters must be equal.
// Otherwise the result is `Never`.
var freshTypeFormalTypes =
- FunctionTypeImpl.relateTypeFormals(f, g, (t, s, _, __) => t == s);
+ FunctionTypeImpl.relateTypeFormals(f, g, (t, s) => t == s);
if (freshTypeFormalTypes == null) {
return NeverTypeImpl.instance;
}
diff --git a/pkg/analyzer/lib/src/dart/element/least_upper_bound.dart b/pkg/analyzer/lib/src/dart/element/least_upper_bound.dart
index 94dd226..55f46ff 100644
--- a/pkg/analyzer/lib/src/dart/element/least_upper_bound.dart
+++ b/pkg/analyzer/lib/src/dart/element/least_upper_bound.dart
@@ -724,7 +724,7 @@
// The bounds of type parameters must be equal.
// Otherwise the result is `Function`.
var freshTypeFormalTypes =
- FunctionTypeImpl.relateTypeFormals(f, g, (t, s, _, __) => t == s);
+ FunctionTypeImpl.relateTypeFormals(f, g, (t, s) => t == s);
if (freshTypeFormalTypes == null) {
return _interfaceTypeFunctionNone;
}
diff --git a/pkg/analyzer/lib/src/dart/element/subtype.dart b/pkg/analyzer/lib/src/dart/element/subtype.dart
index 4c8850c..50ec06d 100644
--- a/pkg/analyzer/lib/src/dart/element/subtype.dart
+++ b/pkg/analyzer/lib/src/dart/element/subtype.dart
@@ -351,8 +351,7 @@
}
// The bounds of type parameters must be equal.
- var freshTypeFormalTypes =
- FunctionTypeImpl.relateTypeFormals(f, g, (t, s, _, __) {
+ var freshTypeFormalTypes = FunctionTypeImpl.relateTypeFormals(f, g, (t, s) {
return isSubtypeOf(t, s) && isSubtypeOf(s, t);
});
if (freshTypeFormalTypes == null) {
diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart
index 94ec607..92ac1d9 100644
--- a/pkg/analyzer/lib/src/dart/element/type.dart
+++ b/pkg/analyzer/lib/src/dart/element/type.dart
@@ -180,8 +180,8 @@
// To test this, we instantiate both types with the same (unique) type
// variables, and see if the result is equal.
if (typeFormals.isNotEmpty) {
- var freshVariables = FunctionTypeImpl.relateTypeFormals(
- this, other, (t, s, _, __) => t == s);
+ var freshVariables =
+ FunctionTypeImpl.relateTypeFormals(this, other, (t, s) => t == s);
if (freshVariables == null) {
return false;
}
@@ -295,9 +295,7 @@
static List<TypeParameterType>? relateTypeFormals(
FunctionType f1,
FunctionType f2,
- bool Function(DartType bound2, DartType bound1,
- TypeParameterElement formal2, TypeParameterElement formal1)
- relation) {
+ bool Function(DartType bound2, DartType bound1) relation) {
List<TypeParameterElement> params1 = f1.typeFormals;
List<TypeParameterElement> params2 = f2.typeFormals;
return relateTypeFormals2(params1, params2, relation);
@@ -306,9 +304,7 @@
static List<TypeParameterType>? relateTypeFormals2(
List<TypeParameterElement> params1,
List<TypeParameterElement> params2,
- bool Function(DartType bound2, DartType bound1,
- TypeParameterElement formal2, TypeParameterElement formal1)
- relation) {
+ bool Function(DartType bound2, DartType bound1) relation) {
int count = params1.length;
if (params2.length != count) {
return null;
@@ -340,7 +336,7 @@
.substituteType(bound1);
bound2 = Substitution.fromPairs(variables2, variablesFresh)
.substituteType(bound2);
- if (!relation(bound2, bound1, p2, p1)) {
+ if (!relation(bound2, bound1)) {
return null;
}