Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
index 550cc634c2e4bc5634da80fc64a9c44652c52f2a..2fed730ff6b74032c55015cd81d6d4572b443624 100644 |
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
@@ -2131,7 +2131,17 @@ class IrBuilderVisitor extends ast.Visitor<ir.Primitive> |
List<ir.Primitive> arguments = argumentsNode.nodes.mapToList(visit); |
// Use default values from the effective target, not the immediate target. |
- ConstructorElement target = constructor.implementation; |
+ ConstructorElement target; |
+ if (constructor == compiler.symbolConstructor) { |
+ // The Symbol constructor should perform validation of its argument |
+ // which is not expressible as a Dart const constructor. Instead, the |
+ // libraries contain a dummy const constructor implementation that |
+ // doesn't perform validation and the compiler compiles a call to |
+ // (non-const) Symbol.validated when it sees new Symbol(...). |
+ target = compiler.symbolValidatedConstructor; |
+ } else { |
+ target = constructor.implementation; |
+ } |
while (target.isRedirectingFactory && !target.isCyclicRedirection) { |
target = target.effectiveTarget.implementation; |
} |