FromBuilder should remove trivial yield between two scans. For example, the query
from i in [1, 2] yield {i} join j in [3, 4]
has a yield after a scan that defines i and before a scan that defines j. The yield is trivial because it returns a record with all variables in scope (just i) and therefore it should simplify to
from i in [1, 2] yield {i} join j in [3, 4]
But it does not remove the yield. At the point where it checks whether the yield is trivial, FromBuilder has already (wrongly) added j to the scope and therefore does not think yield {i} is trivial.
FromBuilder should remove trivial yield between two scans. For example, the query
has a
yield
after a scan that definesi
and before a scan that definesj
. The yield is trivial because it returns a record with all variables in scope (justi
) and therefore it should simplify toBut it does not remove the yield. At the point where it checks whether the yield is trivial,
FromBuilder
has already (wrongly) addedj
to the scope and therefore does not thinkyield {i}
is trivial.