Last active
August 29, 2015 14:23
-
-
Save pjrt/40c06d8b749716d3726e to your computer and use it in GitHub Desktop.
numeric widen on the implicit system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait T[A] | |
object Main { | |
implicit val doubleInst: T[Double] = new T[Double] {} | |
def f[A](a: A)(implicit ev: T[A]): T[A] = ev | |
f(1: Int) | |
f(1: Float) | |
f(1: Double) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Numeric Widen does not extend to the implicit system (it seems). Good :D