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

Unified Diff: pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart

Issue 1637843002: typeInformation in CreateInstance is a kind of TypeExpression (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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: pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
index 63b7528d0711955e8457fc49d0e0b6d417b1e67b..3e990abf6cf37ea86fc8ce99aaee35055f4777d9 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
@@ -114,7 +114,7 @@ class Variable extends Node {
assert(host != null);
}
- String toString() => element == null ? 'Variable' : element.toString();
+ String toString() => element == null ? 'Variable.${hashCode}' : element.toString();
}
/// Read the value of a variable.
@@ -669,7 +669,7 @@ class CreateBox extends Expression {
class CreateInstance extends Expression {
ClassElement classElement;
List<Expression> arguments;
- List<Expression> typeInformation;
+ Expression typeInformation;
SourceInformation sourceInformation;
CreateInstance(this.classElement, this.arguments,
@@ -904,8 +904,9 @@ class ForeignStatement extends ForeignCode implements Statement {
class TypeExpression extends Expression {
final DartType dartType;
final List<Expression> arguments;
+ final bool isForInstance;
- TypeExpression(this.dartType, this.arguments);
+ TypeExpression(this.dartType, this.arguments, this.isForInstance);
accept(ExpressionVisitor visitor) {
return visitor.visitTypeExpression(this);
@@ -1216,7 +1217,7 @@ abstract class RecursiveVisitor implements StatementVisitor, ExpressionVisitor {
visitCreateInstance(CreateInstance node) {
node.arguments.forEach(visitExpression);
- node.typeInformation.forEach(visitExpression);
+ if (node.typeInformation != null) visitExpression(node.typeInformation);
}
visitReifyRuntimeType(ReifyRuntimeType node) {
@@ -1457,7 +1458,8 @@ class RecursiveTransformer extends Transformer {
visitCreateInstance(CreateInstance node) {
_replaceExpressions(node.arguments);
- _replaceExpressions(node.typeInformation);
+ if (node.typeInformation != null)
+ node.typeInformation = visitExpression(node.typeInformation);
asgerf 2016/01/26 10:30:01 I have been told we need {} around the body of mul
sra1 2016/01/26 22:21:08 Done.
return node;
}

Powered by Google App Engine
This is Rietveld 408576698