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

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

Issue 10917110: Revert "Collect the types used in is-checks in the resolver phase." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « lib/compiler/implementation/ssa/codegen.dart ('k') | lib/compiler/implementation/universe.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 8f75031f31160a0f8bcaf7d2538dd6b03b59ebf4..fc82c88311e9514d7b9eadbbafb61a800efa1a99 100644
--- a/lib/compiler/implementation/typechecker.dart
+++ b/lib/compiler/implementation/typechecker.dart
@@ -24,9 +24,9 @@ class TypeCheckerTask extends CompilerTask {
}
}
-abstract class DartType implements Hashable {
- abstract SourceString get name();
- abstract Element get element();
+interface DartType {
+ SourceString get name();
+ Element get element();
/**
* Returns the unaliased type of this type.
@@ -38,9 +38,7 @@ abstract class DartType implements Hashable {
* function type [: (B) -> A :] and the unaliased type of
* [: Func<int,String> :] is the function type [: (String) -> int :].
*/
- abstract DartType unalias(Compiler compiler);
-
- abstract bool equals(other);
+ DartType unalias(Compiler compiler);
}
class TypeVariableType implements DartType {
@@ -52,13 +50,6 @@ class TypeVariableType implements DartType {
DartType unalias(Compiler compiler) => this;
- int hashCode() => 17 * element.hashCode();
-
- bool equals(other) {
- if (other is !TypeVariableType) return false;
- return other.element == element;
- }
-
String toString() => name.slowToString();
}
@@ -84,13 +75,6 @@ class StatementType implements DartType {
DartType unalias(Compiler compiler) => this;
- int hashCode() => 17 * stringName.hashCode();
-
- bool equals(other) {
- if (other is !StatementType) return false;
- return other.stringName == stringName;
- }
-
String toString() => stringName;
}
@@ -101,10 +85,6 @@ class VoidType implements DartType {
DartType unalias(Compiler compiler) => this;
- int hashCode() => 1729;
-
- bool equals(other) => other is VoidType;
-
String toString() => name.slowToString();
}
@@ -129,22 +109,6 @@ class InterfaceType implements DartType {
}
return sb.toString();
}
-
- int hashCode() {
- int hash = element.hashCode();
- for (Link<DartType> arguments = this.arguments;
- !arguments.isEmpty();
- arguments = arguments.tail) {
- int argumentHash = arguments.head != null ? arguments.head.hashCode() : 0;
- hash = 17 * hash + 3 * argumentHash;
- }
- return hash;
- }
-
- bool equals(other) {
- if (other is !InterfaceType) return false;
- return arguments == other.arguments;
- }
}
class FunctionType implements DartType {
@@ -180,22 +144,6 @@ class FunctionType implements DartType {
returnType = other.returnType;
parameterTypes = other.parameterTypes;
}
-
- int hashCode() {
- int hash = 17 * element.hashCode() + 3 * returnType.hashCode();
- for (Link<DartType> parameters = parameterTypes;
- !parameters.isEmpty();
- parameters = parameters.tail) {
- hash = 17 * hash + 3 * parameters.head.hashCode();
- }
- return hash;
- }
-
- bool equals(other) {
- if (other is !FunctionType) return false;
- return returnType == other.returnType
- && parameterTypes == other.parameterTypes;
- }
}
class TypedefType implements DartType {
@@ -223,13 +171,6 @@ class TypedefType implements DartType {
}
return sb.toString();
}
-
- int hashCode() => 17 * element.hashCode();
-
- bool equals(other) {
- if (other is !TypedefType) return false;
- return other.element == element;
- }
}
class Types {
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | lib/compiler/implementation/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698