class Flat[T] { type R = T } implicit def flat[T]: Flat[T] = null def f[A, B]: A with B = null.asInstanceOf[A with B] def g[A, B](implicit flat: Flat[A with B]): flat.R = f[A, B] f[Int with Long, Int] // infers Int with Long with Int g[Int with Long,Int] // infers Int with Long
-
-
Of course) there is no way you actually use that stuff right?)
-
The method g is intended to infer a phantom type, so we never instantiate the inferred you're. In Dotty the value would be erased.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.