ICE: Default type parameter that references Self
in an object type
#18956
Labels
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
This example causes an ICE:
yields
This is because, in an object type, the self parameter slot is empty, so the substitution of the default fails. I'm not 100% sure what's the best way to fix this. We could make the substitution report a proper error rather than ICE; perhaps that's best.
It is debatable whether such a trait ought to be object safe, but it seems harmless, if pointless, since the
Self
type winds up being revealed.The text was updated successfully, but these errors were encountered: