forSome scope introduction conflates distinct types #9410
Labels
fixed in Scala 3
This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
should not compile
typer
The following should not compile;
outerdcannot prove that there exists oneEthat unifies theleft.Sandright.S, but introduces one anyway. We use that to throw aClassCastException.(scastie here) throws
On the other hand, if
outerddirectly calls the morally equivalentoutertp(scastie here), we correctly get an error:Although, a better error would be more like when you do
Which appropriately fails to compile (scastie here):
Original discovery context here.
The text was updated successfully, but these errors were encountered: