Index: pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart |
diff --git a/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart b/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart |
index bb30957660032322d2fb0cd1dd6b4ae16921c054..a894a3a6a3fec3630720b5f18b039607ee724982 100644 |
--- a/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart |
+++ b/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart |
@@ -11,6 +11,7 @@ import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart' |
KernelComplexAssignment, |
KernelConditionalExpression, |
KernelMethodInvocation, |
+ KernelNullAwarePropertyGet, |
KernelPropertyAssign, |
KernelPropertyGet, |
KernelThisExpression, |
@@ -345,19 +346,22 @@ class NullAwarePropertyAccessor extends Accessor { |
Expression _finish( |
Expression body, KernelComplexAssignment complexAssignment) { |
- var nullAwareGuard = new KernelConditionalExpression( |
- buildIsNull(receiverAccess(), offsetForToken(token)), |
+ var offset = offsetForToken(token); |
+ var nullAwareGuard = new ConditionalExpression( |
+ buildIsNull(receiverAccess(), offset), |
new NullLiteral(), |
- body) |
- ..fileOffset = offsetForToken(token); |
- body = makeLet(receiver, nullAwareGuard); |
+ body, |
+ const DynamicType()) |
+ ..fileOffset = offset; |
if (complexAssignment != null) { |
+ body = makeLet(receiver, nullAwareGuard); |
KernelPropertyAssign kernelPropertyAssign = complexAssignment; |
kernelPropertyAssign.nullAwareGuard = nullAwareGuard; |
kernelPropertyAssign.desugared = body; |
return kernelPropertyAssign; |
} else { |
- return body; |
+ return new KernelNullAwarePropertyGet(receiver, nullAwareGuard) |
+ ..fileOffset = offset; |
} |
} |
} |