| Index: lib/ast.dart
|
| diff --git a/lib/ast.dart b/lib/ast.dart
|
| index dc9cb6d746dcd22c33fdaef7ddef60f81a46a564..788f53ec0913c73c55bed72f18009c65a0f84ef6 100644
|
| --- a/lib/ast.dart
|
| +++ b/lib/ast.dart
|
| @@ -1978,28 +1978,17 @@ class ConditionalExpression extends Expression {
|
| Expression then;
|
| Expression otherwise;
|
|
|
| - /// The static type of the expression, or `null` if the type should be derived
|
| - /// from [then] and [otherwise] using a very simple upper bound computation.
|
| - ///
|
| - /// If one of the arms is a null literal, the static type of the other
|
| - /// arm will be used.
|
| + /// The static type of the expression. Should not be `null`.
|
| DartType staticType;
|
|
|
| ConditionalExpression(this.condition, this.then, this.otherwise,
|
| - [this.staticType]) {
|
| + this.staticType) {
|
| condition?.parent = this;
|
| then?.parent = this;
|
| otherwise?.parent = this;
|
| }
|
|
|
| - DartType getStaticType(TypeEnvironment types) {
|
| - if (staticType != null) return staticType;
|
| - var left = then.getStaticType(types);
|
| - var right = otherwise.getStaticType(types);
|
| - if (left is BottomType) return right;
|
| - if (right is BottomType) return left;
|
| - return const DynamicType();
|
| - }
|
| + DartType getStaticType(TypeEnvironment types) => staticType;
|
|
|
| accept(ExpressionVisitor v) => v.visitConditionalExpression(this);
|
|
|
|
|