Index: pkg/kernel/lib/text/ast_to_text.dart |
diff --git a/pkg/kernel/lib/text/ast_to_text.dart b/pkg/kernel/lib/text/ast_to_text.dart |
index cd42481da3670f8288a263807c63f4d178154cc1..2826c444986a0c15537c8a0975bd55335efa72d9 100644 |
--- a/pkg/kernel/lib/text/ast_to_text.dart |
+++ b/pkg/kernel/lib/text/ast_to_text.dart |
@@ -839,7 +839,10 @@ class Printer extends Visitor<Null> { |
visitConditionalExpression(ConditionalExpression node) { |
writeExpression(node.condition, Precedence.LOGICAL_OR); |
- writeSpaced('?'); |
+ ensureSpace(); |
+ write('?'); |
+ writeStaticType(node.staticType); |
+ writeSpace(); |
writeExpression(node.then); |
writeSpaced(':'); |
writeExpression(node.otherwise); |
@@ -1114,6 +1117,14 @@ class Printer extends Visitor<Null> { |
} |
} |
+ void writeStaticType(DartType type) { |
+ if (type != null) { |
+ writeSymbol('{'); |
+ writeType(type); |
+ writeSymbol('}'); |
+ } |
+ } |
+ |
visitPropertyGet(PropertyGet node) { |
writeExpression(node.receiver, Precedence.PRIMARY); |
writeSymbol('.'); |