[Internal] Solve Lambdas in Order Of Capture
tnowacki opened this issue · comments
Currently, we solve lambdas based on the order they were declared. This was likely done as solving one lambda could influence tvars that are used/captured by later lambdas.
But, it does not work well when one lambda is captured by another.
We should order lambda solving first by the capture order, i.e. if a lambda is captured by another lambda, solve the captured one first. And then defer to declared order