so solve
has its own Scope
that's distinct from the one we have during canonicalization
it looks like entries only ever get added to it via from_def_types
which in turn looks like it gets all of its info from constraints that were generated earlier
I'm interested in this because during solving we run clone
on scope
in various places, and I'm wondering if that's really necessary, or if there's some way we could have put the right Variable
inside the Let
earlier on (e.g. during canonicalization) such that it wouldn't need to be looked up later
in other words, it seems like solving is redoing some of the work canonicalization has already done (figuring out what a given lookup refers to in the context of the scope) and it's doing a bunch of hash table cloning in the process
so I wonder if we could prevent all that cloning by storing the associated variable right when we create the Lookup
constraint itself, for example
Last updated: Jul 06 2025 at 12:14 UTC