Open smarter opened 3 months ago
Related to #20515
Yes indeed, #20515 is likely to require a more general fix.
This is mostly speculative but the problem seems to me to be assuming
(t: W[Any]).X =:= (t: W[Any]).type match {...} =:= W[Any] match {...}
when the second equality should really just be a subtyping relationship (IIRC the substitution happens before beginning match type reduction).
Compiler version
3.5.1-RC1-bin-20240602-c6fbe6f-NIGHTLY
Minimized code
This is a variation of @EugeneFlesselle's #19746:
The fix for #19746 in https://github.com/scala/scala3/commit/0a3497bf7f0ac032f98d36cf1713e8926b5d176c should be generalized to check
is(Param)
in prefixes too (and maybe that should also apply to TypeRef and not just TermRef).