Chromium Code Reviews| Index: lib/compiler/implementation/typechecker.dart |
| diff --git a/lib/compiler/implementation/typechecker.dart b/lib/compiler/implementation/typechecker.dart |
| index c34ea42966ea076133ada47ab8eda3895ad6cb9f..fa636ac721cd153d3947002e4f9080daa76f73f9 100644 |
| --- a/lib/compiler/implementation/typechecker.dart |
| +++ b/lib/compiler/implementation/typechecker.dart |
| @@ -41,7 +41,7 @@ abstract class DartType implements Hashable { |
| */ |
| abstract DartType unalias(Compiler compiler); |
| - abstract bool equals(other); |
| + abstract bool operator ==(other); |
| } |
| class TypeVariableType implements DartType { |
| @@ -55,7 +55,7 @@ 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; |
|
ahe
2012/09/17 08:19:58
===
Johnni Winther
2012/09/18 08:14:30
Done.
|
| } |
| @@ -87,7 +87,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; |
| } |
| @@ -104,7 +104,7 @@ class VoidType implements DartType { |
| int hashCode() => 1729; |
| - bool equals(other) => other is VoidType; |
| + bool operator ==(other) => other is VoidType; |
| String toString() => name.slowToString(); |
| } |
| @@ -142,8 +142,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; |
|
ahe
2012/09/17 08:19:58
!==
Johnni Winther
2012/09/18 08:14:30
Done.
|
| return arguments == other.arguments; |
| } |
| } |
| @@ -194,7 +195,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; |
| @@ -229,9 +230,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; |
|
ahe
2012/09/17 08:19:58
!==
Johnni Winther
2012/09/18 08:14:30
Done.
|
| + return typeArguments == other.typeArguments; |
| } |
| } |