Open
Description
Code
I tried this code:
struct Foo<const N: u32, const M: u64 = N>;
I expected to see this happen: It fail to compile like it uised to
Instead, this happened: it compile :>
Probably regressed in #125915 where we started lowering const arguments to ConstArgKind::Path
instead of ConstArgKind::Anon
so there is no longer implicitly an anon const with an expected type of u64
with an expr typed as u32
.
We could probably special case handling of types of defaulted const generics in wfcheck to be done even when generics are involved. Or just accept this as working code which is consistent with things like struct Foo<T, U = <T as Iterator>::Item>(T, U);
🤷♀ would need a types fcp for that tho
I don't believe this to be a soundness bug