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

Unified Diff: pkg/compiler/lib/src/constants/values.dart

Issue 1777483006: Recognize identical() ConstantValues as equal. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/constants/values.dart
diff --git a/pkg/compiler/lib/src/constants/values.dart b/pkg/compiler/lib/src/constants/values.dart
index fde5cde807a91492704ee808f42a302b546c72f9..3b0ed7d3cbd3c7f4d805eb4274f7ab8745f7b8cf 100644
--- a/pkg/compiler/lib/src/constants/values.dart
+++ b/pkg/compiler/lib/src/constants/values.dart
@@ -389,6 +389,7 @@ class StringConstantValue extends PrimitiveConstantValue {
DartType getType(CoreTypes types) => types.stringType;
bool operator ==(var other) {
+ if (identical(this, other)) return true;
if (other is !StringConstantValue) return false;
StringConstantValue otherString = other;
return hashCode == otherString.hashCode &&
@@ -461,6 +462,7 @@ class ListConstantValue extends ObjectConstantValue {
bool get isList => true;
bool operator ==(var other) {
+ if (identical(this, other)) return true;
if (other is !ListConstantValue) return false;
ListConstantValue otherList = other;
if (hashCode != otherList.hashCode) return false;
@@ -525,6 +527,7 @@ class MapConstantValue extends ObjectConstantValue {
bool get isMap => true;
bool operator ==(var other) {
+ if (identical(this, other)) return true;
if (other is !MapConstantValue) return false;
MapConstantValue otherMap = other;
if (hashCode != otherMap.hashCode) return false;
@@ -661,6 +664,7 @@ class ConstructedConstantValue extends ObjectConstantValue {
bool get isConstructedObject => true;
bool operator ==(var otherVar) {
+ if (identical(this, otherVar)) return true;
if (otherVar is !ConstructedConstantValue) return false;
ConstructedConstantValue other = otherVar;
if (hashCode != other.hashCode) return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698