Created
December 3, 2014 13:23
-
-
Save propensive/624df1423c27bee56535 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| case class Instantiator[T]() | |
| def instantiate[T](implicit inst: Instantiator[T]): T = null.asInstanceOf[T] | |
| val x: String = instantiate | |
| // error: could not find implicit for Instantiator[T] | |
| implicit def inst1: Instantiator[String] = Instantiator[String] | |
| implicit def inst2: Instantiator[Int] = Instantiator[Int] | |
| val x: String = instantiate | |
| // error: ambiguous implicits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment