The safety check doesn't reorder expressions around comprehensions before checking nested bodies. As a result, the safety check can generate false positives. Consider:
x = y.a
y = input.y
{1 | x}
In this contrived example, x will not be considered safe when the comprehension is checked. As a result, the body of the comprehension on L3 will be considered unsafe. The reason x is not considered safe is that the safety reordering will not have been applied to the first two expressions yet.
We should improve the safety check so that comprehensions do not have to be checked up-front and instead can be checked in the process of normal reordering.
The safety check doesn't reorder expressions around comprehensions before checking nested bodies. As a result, the safety check can generate false positives. Consider:
In this contrived example,
x
will not be considered safe when the comprehension is checked. As a result, the body of the comprehension on L3 will be considered unsafe. The reasonx
is not considered safe is that the safety reordering will not have been applied to the first two expressions yet.We should improve the safety check so that comprehensions do not have to be checked up-front and instead can be checked in the process of normal reordering.