diff --git a/pkg/analyzer/lib/src/dart/element/runtime_type_equality.dart b/pkg/analyzer/lib/src/dart/element/runtime_type_equality.dart index fc3ec5e2e2d..5364c58d561 100644 --- a/pkg/analyzer/lib/src/dart/element/runtime_type_equality.dart +++ b/pkg/analyzer/lib/src/dart/element/runtime_type_equality.dart @@ -88,7 +88,7 @@ class RuntimeTypeEqualityVisitor @override bool visitInterfaceType(InterfaceType T1, DartType T2) { if (T2 is InterfaceType && - T1.element == T2.element && + identical(T1.element, T2.element) && _compatibleNullability(T1, T2)) { var T1_typeArguments = T1.typeArguments; var T2_typeArguments = T2.typeArguments; @@ -167,7 +167,7 @@ class RuntimeTypeEqualityVisitor bool visitTypeParameterType(TypeParameterType T1, DartType T2) { return T2 is TypeParameterType && _compatibleNullability(T1, T2) && - T1.element == T2.element; + identical(T1.element, T2.element); } @override