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

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: Fix an assert. 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 b769c277debca94232506e9c3a6021b74175d8fe..a7695f126b2d3cb46c40a67edf255c66848763fa 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) {
+ 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) {
+ element = element.targetConstructor;
+ }
+
return selector.addArgumentsToList(arguments,
list,
element,
@@ -3375,6 +3381,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