You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following snippet. Casting to existential causing the error "can't existentially abstract over parameterized type F".
test1 fails for both scala 2.10 and 2.11 test2 works for 2.10 but fails for 2.11 test3 works for 2.10 and 2.11
// define container trait, type alias and valuetraitContainer[F[_]]
typeCC[F[_]] =Container[F]
valc=newCC[Option] {}
// fails for 2.10 and 2.11// error: can't existentially abstract over parameterized type FtypeSomeContainer=Container[F] forSome { typeF[_] }
valtest1= c.asInstanceOf[SomeContainer]
// works for 2.10 but fails for 2.11typeSomeCC=CC[F] forSome { typeF[_] }
implicitly[SomeContainer=:=SomeCC]
valtest2= c.asInstanceOf[SomeCC]
// workaround for 2.11 but isn't it the same as test2?typeSomeF[X] =F[X] forSome { typeF[_] }
implicitly[SomeCC=:=CC[SomeF]]
valtest3= c.asInstanceOf[CC[SomeF]]
from my point of view test1 and test2 should work either
The text was updated successfully, but these errors were encountered:
Consider the following snippet. Casting to existential causing the error "can't existentially abstract over parameterized type F".
test1
fails for both scala 2.10 and 2.11test2
works for 2.10 but fails for 2.11test3
works for 2.10 and 2.11from my point of view
test1
andtest2
should work eitherThe text was updated successfully, but these errors were encountered: