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

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

Issue 10105027: Remove SimpleType. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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/resolver.dart ('k') | no next file » | 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 80364dedfe1e348ac42bd2d0ca219626015875b1..e92e5158b3be92895480128a32d310927ed82922 100644
--- a/lib/compiler/implementation/typechecker.dart
+++ b/lib/compiler/implementation/typechecker.dart
@@ -65,7 +65,8 @@ class InterfaceType implements Type {
final Element element;
final Link<Type> arguments;
- const InterfaceType(this.name, this.element, this.arguments);
+ const InterfaceType(this.name, this.element,
+ [this.arguments = const EmptyLink<Type>()]);
toString() {
StringBuffer sb = new StringBuffer();
@@ -79,13 +80,6 @@ class InterfaceType implements Type {
}
}
-// TODO(karlklose): merge into InterfaceType as a named constructor.
-class SimpleType extends InterfaceType {
- const SimpleType(SourceString name, Element element)
- : super(name, element, const EmptyLink<Type>());
- String toString() => name.slowToString();
-}
-
class FunctionType implements Type {
final Element element;
final Type returnType;
@@ -116,14 +110,14 @@ class Types {
static final OBJECT = const SourceString('Object');
static final LIST = const SourceString('List');
- final SimpleType voidType;
- final SimpleType dynamicType;
+ final InterfaceType voidType;
+ final InterfaceType dynamicType;
Types() : this.with(new LibraryElement(new Script(null, null)));
Types.with(LibraryElement library)
- : voidType = new SimpleType(VOID, new ClassElement(VOID, library)),
- dynamicType = new SimpleType(DYNAMIC, new ClassElement(DYNAMIC, library));
+ : voidType = new InterfaceType(VOID, new ClassElement(VOID, library)),
+ dynamicType = new InterfaceType(DYNAMIC, new ClassElement(DYNAMIC, library));
Type lookup(SourceString s) {
if (VOID == s) {
@@ -138,8 +132,8 @@ class Types {
bool isSubtype(Type t, Type s) {
if (t === s || t === dynamicType || s === dynamicType ||
s.name == OBJECT) return true;
- if (t is SimpleType) {
- if (s is !SimpleType) return false;
+ if (t is InterfaceType) {
+ if (s is !InterfaceType) return false;
ClassElement tc = t.element;
for (Link<Type> supertypes = tc.allSupertypes;
supertypes != null && !supertypes.isEmpty();
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698