Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(844)

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart

Issue 17569004: Implement hashCode on objects stored in a set or used as map keys. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased on CL 17588005. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart b/dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
index f74db6e01fb66911c5769bab55b85a189dd4f366..f9fc65907ed0e40810d311138085a549c8aa25ff 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
@@ -10,6 +10,8 @@ part of types;
class ElementTypeHolder {
// This field will be set after global analysis.
TypeMask elementType;
+
+ int get hashCode => elementType.hashCode;
}
/// A [ContainerTypeMask] is a [TypeMask] for a specific allocation
@@ -81,6 +83,8 @@ class ContainerTypeMask extends ForwardingTypeMask {
&& isNullable == other.isNullable;
}
+ int get hashCode => computeHashCode(allocationNode, isNullable);
+
String toString() {
return 'Container mask: $elementType';
}

Powered by Google App Engine
This is Rietveld 408576698