@@ -502,20 +502,23 @@ module API {
502502 // - `awaitedValue` is `l`
503503 // - `result` is `l` (should perhaps be `x`, but that should really be a read)
504504 exists ( AsyncFor asyncFor |
505- result .asExpr ( ) = asyncFor .getTarget ( ) and
506- // Morally , we should perhaps use asyncFor.getIter () = awaitedValue.asExpr(),
507- // but that is actually behind a read step rather than a flow step.
508- asyncFor .getTarget ( ) = awaitedValue .asExpr ( )
505+ result .asExpr ( ) = asyncFor .getIter ( ) and
506+ // To consider `x` the result of awaiting , we would use asyncFor.getTarget () = awaitedValue.asExpr(),
507+ // but that is behind a read step rather than a flow step.
508+ asyncFor .getIter ( ) = awaitedValue .asExpr ( )
509509 )
510510 or
511511 // `async with x as y`
512512 // - `awaitedValue` is `x`
513- // - `result` is `x` (should probably be `y` but it might not exist)
513+ // - `result` is `x` and `y` if it exists
514514 exists ( AsyncWith asyncWith |
515515 result .asExpr ( ) = asyncWith .getContextExpr ( ) and
516- // Morally, we should perhaps use asyncWith.getOptionalVars() = awaitedValue.asExpr(),
517- // but that might not exist.
518- asyncWith .getContextExpr ( ) = awaitedValue .asExpr ( )
516+ awaitedValue .asExpr ( ) in [
517+ // `x`
518+ asyncWith .getContextExpr ( ) ,
519+ // `y`, if it exists
520+ asyncWith .getOptionalVars ( )
521+ ]
519522 )
520523 }
521524
0 commit comments