forSome scope introduction conflates distinct types #9410
Labels
existential
fixed in Scala 3
This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
should not compile
typer
Milestone
The following should not compile;
outerd
cannot prove that there exists oneE
that unifies theleft.S
andright.S
, but introduces one anyway. We use that to throw aClassCastException
.(scastie here) throws
On the other hand, if
outerd
directly 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: