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

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

Issue 11230007: Resolve redirecting factories. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handle unresolved elements. Created 8 years, 2 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
Index: dart/lib/compiler/implementation/typechecker.dart
diff --git a/dart/lib/compiler/implementation/typechecker.dart b/dart/lib/compiler/implementation/typechecker.dart
index 33b1dced3c9a08f531db2633816d70e59d34e2aa..909641c5830f98a789f8afe5efd9b2ecc32e6ea9 100644
--- a/dart/lib/compiler/implementation/typechecker.dart
+++ b/dart/lib/compiler/implementation/typechecker.dart
@@ -51,6 +51,8 @@ abstract class DartType {
abstract DartType unalias(Compiler compiler);
abstract bool operator ==(other);
+
+ DartType asRaw() => this;
}
class TypeVariableType implements DartType {
@@ -156,6 +158,11 @@ class InterfaceType implements DartType {
if (!identical(element, other.element)) return false;
return arguments == other.arguments;
}
+
+ InterfaceType asRaw() {
+ if (arguments.isEmpty()) return this;
+ return new InterfaceType(element);
+ }
}
class FunctionType implements DartType {
@@ -753,7 +760,7 @@ class TypeCheckerVisitor implements Visitor<DartType> {
if (node.isRedirectingFactoryBody) {
// TODO(lrn): Typecheck the body. It must refer to the constructor
// of a subtype.
- return elements.getType(node);
+ return StatementType.RETURNING;
}
final expression = node.expression;

Powered by Google App Engine
This is Rietveld 408576698