Open julianhyde opened 5 months ago
Another optimization:
from d in dept join loc in [d.loc] yield loc
should become
from d in dept join yield d.loc
The singleton join loc in [d.loc]
should be seen as a project, yield {d, d.loc}
, and therefore it can be merged with the following yield loc
.
FromBuilder
should remove intermediate renames. ConsiderThis can be converted to
The
yield {a = j, b = i}
is removed; all occurrences ofa
after the yield are replaced withi
, and all occurrences ofb
are replaced withj.
A final
yield
is added to ensure that thefrom
expression still has type{a:int, b:int} list
.The variable
k
is dead after the yield, and must not be used. (Do we need to add a new subclass ofCore.FromStep
to kill variables?)