| Index: pkg/analyzer/lib/src/dart/element/type.dart
|
| diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart
|
| index 0a47f064287c0204c1b91c4d2b85d50ebca847cf..da017f5d5c4bff17daebc8b8c9bb2b7bbb0eb6fb 100644
|
| --- a/pkg/analyzer/lib/src/dart/element/type.dart
|
| +++ b/pkg/analyzer/lib/src/dart/element/type.dart
|
| @@ -2036,6 +2036,20 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
|
| if (argumentTypes.length == 0 || typeArguments.length == 0) {
|
| return this.pruned(prune);
|
| }
|
| +
|
| + // If every parameter type is equal to the corresponding argument type,
|
| + // then the type will not change. Return it as is.
|
| + bool isIdentityTransformation = true;
|
| + for (int i = 0; i < parameterTypes.length; i++) {
|
| + if (parameterTypes[i] != argumentTypes[i]) {
|
| + isIdentityTransformation = false;
|
| + break;
|
| + }
|
| + }
|
| + if (isIdentityTransformation) {
|
| + return this;
|
| + }
|
| +
|
| List<DartType> newTypeArguments = TypeImpl.substitute(
|
| typeArguments, argumentTypes, parameterTypes, prune);
|
|
|
|
|