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

Unified Diff: lib/compiler/implementation/typechecker.dart

Issue 10917290: DartType equals converted to operator == and tested. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years, 3 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 | lib/compiler/implementation/util/link.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/typechecker.dart
diff --git a/lib/compiler/implementation/typechecker.dart b/lib/compiler/implementation/typechecker.dart
index 50d34a1fc8b31635606cc8e5e4c877f9b420782a..85e9cf39e6d5b6e9f7ec5918cb6d7b74364198b4 100644
--- a/lib/compiler/implementation/typechecker.dart
+++ b/lib/compiler/implementation/typechecker.dart
@@ -40,7 +40,7 @@ abstract class DartType implements Hashable {
*/
abstract DartType unalias(Compiler compiler);
- abstract bool equals(other);
+ abstract bool operator ==(other);
}
class TypeVariableType implements DartType {
@@ -54,9 +54,9 @@ class TypeVariableType implements DartType {
int hashCode() => 17 * element.hashCode();
- bool equals(other) {
+ bool operator ==(other) {
if (other is !TypeVariableType) return false;
- return other.element == element;
+ return other.element === element;
}
String toString() => name.slowToString();
@@ -86,7 +86,7 @@ class StatementType implements DartType {
int hashCode() => 17 * stringName.hashCode();
- bool equals(other) {
+ bool operator ==(other) {
if (other is !StatementType) return false;
return other.stringName == stringName;
}
@@ -103,7 +103,7 @@ class VoidType implements DartType {
int hashCode() => 1729;
- bool equals(other) => other is VoidType;
+ bool operator ==(other) => other is VoidType;
String toString() => name.slowToString();
}
@@ -141,8 +141,9 @@ class InterfaceType implements DartType {
return hash;
}
- bool equals(other) {
+ bool operator ==(other) {
if (other is !InterfaceType) return false;
+ if (element !== other.element) return false;
return arguments == other.arguments;
}
}
@@ -191,7 +192,7 @@ class FunctionType implements DartType {
return hash;
}
- bool equals(other) {
+ bool operator ==(other) {
if (other is !FunctionType) return false;
return returnType == other.returnType
&& parameterTypes == other.parameterTypes;
@@ -226,9 +227,10 @@ class TypedefType implements DartType {
int hashCode() => 17 * element.hashCode();
- bool equals(other) {
+ bool operator ==(other) {
if (other is !TypedefType) return false;
- return other.element == element;
+ if (element !== other.element) return false;
+ return typeArguments == other.typeArguments;
}
}
« no previous file with comments | « no previous file | lib/compiler/implementation/util/link.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698