Bit of a weird one and might be pointless to think about but in the following erroneous snippet
trait DynT {}
fn f(_: &dyn DynT) {}
fn main() {
let unresolved = unresolved;
f(&unresolved);
unresolved.foo();
}
we assign dyn DynT to unresolved. I feel like this is a bad recovery, since we can't have unsized locals, imo it would be better in this case to fallback to an error type? Interestingly enough if we assign an error type reference to unresolved we also fall back to the same type instead of assigning an error type to the local, probably because unification takes over still.
cc @ChayimFriedman2 idk if you have opinions on this, if you think this is fine as is feel free to close :)
Bit of a weird one and might be pointless to think about but in the following erroneous snippet
we assign
dyn DynTtounresolved. I feel like this is a bad recovery, since we can't have unsized locals, imo it would be better in this case to fallback to an error type? Interestingly enough if we assign an error type reference tounresolvedwe also fall back to the same type instead of assigning an error type to the local, probably because unification takes over still.cc @ChayimFriedman2 idk if you have opinions on this, if you think this is fine as is feel free to close :)