Index: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart |
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart |
index c61fe0bb5a2db33dab7c98bd626c7711a8b17f38..6737745c51dca31d17e7aa2a8df78545dccfe054 100644 |
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart |
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart |
@@ -35,6 +35,21 @@ class KernelBlock extends Block implements KernelStatement { |
} |
} |
+/// Concrete shadow object representing a conditional expression in kernel form. |
+class KernelConditionalExpression extends ConditionalExpression |
+ implements KernelExpression { |
+ KernelConditionalExpression( |
+ Expression condition, Expression then, Expression otherwise) |
+ : super(condition, then, otherwise, const DynamicType()); |
+ |
+ @override |
+ DartType _inferExpression( |
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
+ return inferrer.inferConditionalExpression(typeContext, typeNeeded, |
+ condition, then, otherwise, (type) => staticType = type); |
+ } |
+} |
+ |
/// Common base class for shadow objects representing expressions in kernel |
/// form. |
abstract class KernelExpression implements Expression { |