@@ -340,7 +340,7 @@ class _AstToIrVisitor implements cdAst.AstVisitor {
340340 // Notice that the first guard condition is the left hand of the left most safe access node
341341 // which comes in as leftMostSafe to this routine.
342342
343- let guardedExpression = this . visit ( leftMostSafe . receiver , mode ) ;
343+ let guardedExpression = this . visit ( leftMostSafe . receiver , _Mode . Expression ) ;
344344 let temporary : o . ReadVarExpr ;
345345 if ( this . needsTemporary ( leftMostSafe . receiver ) ) {
346346 // If the expression has method calls or pipes then we need to save the result into a
@@ -369,7 +369,7 @@ class _AstToIrVisitor implements cdAst.AstVisitor {
369369 }
370370
371371 // Recursively convert the node now without the guarded member access.
372- const access = this . visit ( ast , mode ) ;
372+ const access = this . visit ( ast , _Mode . Expression ) ;
373373
374374 // Remove the mapping. This is not strictly required as the converter only traverses each node
375375 // once but is safer if the conversion is changed to traverse the nodes more than once.
@@ -381,7 +381,7 @@ class _AstToIrVisitor implements cdAst.AstVisitor {
381381 }
382382
383383 // Produce the conditional
384- return condition . conditional ( o . literal ( null ) , access ) ;
384+ return convertToStatementIfNeeded ( mode , condition . conditional ( o . literal ( null ) , access ) ) ;
385385 }
386386
387387 // Given a expression of the form a?.b.c?.d.e the the left most safe node is
0 commit comments