| Index: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
|
| index 3b71d9adc3e9594612cd22a96079363539b94d6a..f6d3e8840698056fead66175af79706fe407e4a0 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
|
| @@ -207,11 +207,21 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
|
| }
|
|
|
| String visitInvokeConstructor(InvokeConstructor node) {
|
| + String className;
|
| + // TODO(karlklose): for illegal nodes constructed for tests or unresolved
|
| + // constructor calls in the DartBackend, we get an element with no enclosing
|
| + // class. Clean this up by introducing a name field to the node and
|
| + // removing [ErroneousElement]s from the IR.
|
| + if (node.type != null) {
|
| + className = node.type.toString();
|
| + } else {
|
| + className = node.target.enclosingClass.name;
|
| + }
|
| String callName;
|
| if (node.target.name.isEmpty) {
|
| - callName = '${node.type}';
|
| + callName = '${className}';
|
| } else {
|
| - callName = '${node.type}.${node.target.name}';
|
| + callName = '${className}.${node.target.name}';
|
| }
|
| String cont = access(node.continuation);
|
| String args = formatArguments(node);
|
| @@ -323,7 +333,8 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
|
| String visitCreateInstance(CreateInstance node) {
|
| String className = node.classElement.name;
|
| String arguments = node.arguments.map(access).join(' ');
|
| - return '(CreateInstance $className ($arguments))';
|
| + String typeInformation = node.typeInformation.map(access).join(' ');
|
| + return '(CreateInstance $className ($arguments)$typeInformation)';
|
| }
|
|
|
| String visitIdentical(Identical node) {
|
| @@ -343,6 +354,12 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
|
| String visitReadTypeVariable(ReadTypeVariable node) {
|
| return '(ReadTypeVariable ${access(node.target)}.${node.variable})';
|
| }
|
| +
|
| + @override
|
| + String visitTypeExpression(TypeExpression node) {
|
| + String args = node.arguments.map(access).join(', ');
|
| + return '(TypeExpression ${node.dartType.toString()} $args)';
|
| + }
|
| }
|
|
|
| class ConstantStringifier extends ConstantValueVisitor<String, Null> {
|
| @@ -427,7 +444,9 @@ class _Namer {
|
|
|
| String nameParameter(Parameter parameter) {
|
| assert(!_names.containsKey(parameter));
|
| - return _names[parameter] = parameter.hint.name;
|
| + String name =
|
| + parameter.hint != null ? parameter.hint.name : nameValue(parameter);
|
| + return _names[parameter] = name;
|
| }
|
|
|
| String nameMutableVariable(MutableVariable variable) {
|
|
|