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

Unified Diff: lib/compiler/implementation/types/concrete_types_inferrer.dart

Issue 10942028: Support class and typedef literals as expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Peter's comments. Created 8 years, 1 month 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
Index: lib/compiler/implementation/types/concrete_types_inferrer.dart
diff --git a/lib/compiler/implementation/types/concrete_types_inferrer.dart b/lib/compiler/implementation/types/concrete_types_inferrer.dart
index dd66e61622401c768eea4d27b2446e74e9878ef0..390416cb1c4ae28c0e3cc6d2f9ad9463a32edc01 100644
--- a/lib/compiler/implementation/types/concrete_types_inferrer.dart
+++ b/lib/compiler/implementation/types/concrete_types_inferrer.dart
@@ -261,6 +261,7 @@ class BaseTypes {
final BaseType listBaseType;
final BaseType mapBaseType;
final BaseType objectBaseType;
+ final BaseType typeBaseType;
BaseTypes(Compiler compiler) :
intBaseType = new ClassBaseType(compiler.intClass),
@@ -270,7 +271,8 @@ class BaseTypes {
stringBaseType = new ClassBaseType(compiler.stringClass),
listBaseType = new ClassBaseType(compiler.listClass),
mapBaseType = new ClassBaseType(compiler.mapClass),
- objectBaseType = new ClassBaseType(compiler.objectClass);
+ objectBaseType = new ClassBaseType(compiler.objectClass),
+ typeBaseType = new ClassBaseType(compiler.typeClass);
}
/**
@@ -1390,4 +1392,8 @@ class TypeInferrerVisitor extends ResolvedVisitor<ConcreteType> {
void internalError(String reason, {Node node}) {
inferrer.fail(node, reason);
}
+
+ ConcreteType visitTypeReferenceSend(Send) {
+ return new ConcreteType.singleton(inferrer.baseTypes.typeBaseType);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698