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
-
-
-
-
Replying to @propensive
Of course) there is no way you actually use that stuff right?)
2 replies 0 retweets 0 likes
Replying to @BesseIFunction
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.
11:45 PM - 3 Mar 2019
0 replies
0 retweets
0 likes
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.