[dart2js] Add == override to Dart2JS ir.InterfaceType subclasses.

These subtypes were previously colliding with instances of the base ir.InterfaceType class in the interner map.

Change-Id: Iec6b53fa82e0994142c408a0a2be1ddd045898e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255257
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
diff --git a/pkg/compiler/lib/src/ir/static_type_base.dart b/pkg/compiler/lib/src/ir/static_type_base.dart
index 9357bb0..d71ba62 100644
--- a/pkg/compiler/lib/src/ir/static_type_base.dart
+++ b/pkg/compiler/lib/src/ir/static_type_base.dart
@@ -26,6 +26,14 @@
       ? ThisInterfaceType(type.classNode, type.nullability, type.typeArguments)
       : null;
 
+  /// We rely on the [ir.InterfaceType] implementation of [hashCode]. Collisions
+  /// should be infrequent enough.
+  @override
+  bool operator ==(Object other) {
+    if (other is! ThisInterfaceType) return false;
+    return super == other;
+  }
+
   @override
   String toString() => 'this:${super.toString()}';
 }
@@ -41,6 +49,14 @@
       ? ExactInterfaceType(type.classNode, type.nullability, type.typeArguments)
       : null;
 
+  /// We rely on the [ir.InterfaceType] implementation of [hashCode]. Collisions
+  /// should be infrequent enough.
+  @override
+  bool operator ==(Object other) {
+    if (other is! ExactInterfaceType) return false;
+    return super == other;
+  }
+
   @override
   String toString() => 'exact:${super.toString()}';
 }