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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 14168003: Implement implicit constructors in mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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
Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index cb9a7dd8c0f4b13e042f849f0047fb6b79765711..4fe7490bc3f6e01dc0cee5b6c987631902ee92c4 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -1305,9 +1305,11 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
// Build the initializers in the context of the new constructor.
TreeElements oldElements = elements;
+ if (constructor.isForwardingConstructor) {
kasperl 2013/04/25 12:13:12 How does this work if the target constructor is a
karlklose 2013/05/03 09:35:45 They are now short-circuited.
+ constructor = constructor.targetConstructor;
+ }
elements =
compiler.enqueuer.resolution.getCachedElements(constructor);
-
ClosureClassMap oldClosureData = localsHandler.closureData;
Node node = constructor.parseNode(compiler);
ClosureClassMap newClosureData =
@@ -2883,6 +2885,10 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
return pop();
}
+ if (element.isForwardingConstructor) {
kasperl 2013/04/25 12:13:12 Same comment as above.
karlklose 2013/05/03 09:35:45 Done.
karlklose 2013/05/03 09:35:45 I added an invariant when they are created.
+ element = element.targetConstructor;
+ }
+
return selector.addArgumentsToList(arguments,
list,
element,
@@ -3378,6 +3384,10 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
Element constructor = elements[node];
Selector selector = elements.getSelector(node);
+ if (constructor.isForwardingConstructor) {
+ compiler.unimplemented('forwarded constructor in named mixin application',
+ element: constructor.getEnclosingClass());
+ }
if (compiler.enqueuer.resolution.getCachedElements(constructor) == null) {
compiler.internalError("Unresolved element: $constructor", node: node);
}

Powered by Google App Engine
This is Rietveld 408576698