| Index: pkg/kernel/lib/ast.dart
|
| diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart
|
| index 9d6d5cdd073424bf9d2999e6e6673af3d96dd8bc..297af4b5b8d2cdaa0a656539b92f53ec25bf8f5b 100644
|
| --- a/pkg/kernel/lib/ast.dart
|
| +++ b/pkg/kernel/lib/ast.dart
|
| @@ -1429,7 +1429,10 @@ class VariableGet extends Expression {
|
| VariableDeclaration variable;
|
| DartType promotedType; // Null if not promoted.
|
|
|
| - VariableGet(this.variable, [this.promotedType]);
|
| + VariableGet(VariableDeclaration variable, [DartType promotedType])
|
| + : this.forMixin(variable, promotedType);
|
| +
|
| + VariableGet.forMixin(this.variable, this.promotedType);
|
|
|
| DartType getStaticType(TypeEnvironment types) {
|
| return promotedType ?? variable.type;
|
| @@ -2530,8 +2533,11 @@ class ListLiteral extends Expression {
|
| DartType typeArgument; // Not null, defaults to DynamicType.
|
| final List<Expression> expressions;
|
|
|
| - ListLiteral(this.expressions,
|
| - {this.typeArgument: const DynamicType(), this.isConst: false}) {
|
| + ListLiteral(List<Expression> expressions,
|
| + {DartType typeArgument: const DynamicType(), bool isConst: false})
|
| + : this.forMixin(expressions, typeArgument, isConst);
|
| +
|
| + ListLiteral.forMixin(this.expressions, this.typeArgument, this.isConst) {
|
| assert(typeArgument != null);
|
| setParents(expressions, this);
|
| }
|
| @@ -3172,7 +3178,9 @@ class IfStatement extends Statement {
|
| class ReturnStatement extends Statement {
|
| Expression expression; // May be null.
|
|
|
| - ReturnStatement([this.expression]) {
|
| + ReturnStatement([Expression expression]) : this.forMixin(expression);
|
| +
|
| + ReturnStatement.forMixin(this.expression) {
|
| expression?.parent = this;
|
| }
|
|
|
| @@ -3361,12 +3369,16 @@ class VariableDeclaration extends Statement {
|
| /// Should be null in other cases.
|
| Expression initializer; // May be null.
|
|
|
| - VariableDeclaration(this.name,
|
| - {this.initializer,
|
| - this.type: const DynamicType(),
|
| - this.inferredValue,
|
| + VariableDeclaration(String name,
|
| + {Expression initializer,
|
| + DartType type: const DynamicType(),
|
| + InferredValue inferredValue,
|
| bool isFinal: false,
|
| - bool isConst: false}) {
|
| + bool isConst: false})
|
| + : this.forMixin(name, initializer, type, inferredValue, isFinal, isConst);
|
| +
|
| + VariableDeclaration.forMixin(this.name, this.initializer, this.type,
|
| + this.inferredValue, bool isFinal, bool isConst) {
|
| assert(type != null);
|
| initializer?.parent = this;
|
| this.isFinal = isFinal;
|
|
|