[compiler-v2] Ability constraints are not shallow #12674
Labels
bug
Something isn't working
compiler-v2
stale-exempt
Prevents issues from being automatically marked and closed as stale
The current type constraint mechanism of v2 assumes that a constraint can be resolved if a shallow binding of a type variable is provided. However, that is not true for ability constraints. Consider e.g.
Box<tvar>
-- we don't know the abilities of the shallow outer type unless we know the typetvar
.Since this seems to be a rare scenario, for now we bail out with an error "type annotation needed" if coming along this case. Instead, we may do full constraint derivation (which we need to do for traits anyway, eventually), by breaking down ability constraints for structured types into constraints of the components.
The text was updated successfully, but these errors were encountered: