Closed
Description
I'm pretty sure that it is possible for the following things to happen today:
- We infer a type with bounds X <: T <: top
- We resolve T structurally based on X
- T acquires an upper bound and perhaps migrates away
I don't have a specific bad example, but I think it could lead to inconsistencies, perhaps with impl dispatch, perhaps elsewhere. This issue is kind of a note to myself to come up with some examples and make some tests and be sure we're ok. I think what it amounts to is that whenever we do a type-dependent operation, we should go back and assert this type as the upper-bound, so that the type inferencer doesn't come away with a more liberal upper-bound.
Our quite limited subtyping might also make this less relevant.