Created
December 7, 2012 01:59
-
-
Save stephenjudkins/4230122 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
scala> @annotation.implicitNotFound("whoa there! ${A} is not ${B}, buddy") trait Equals[A,B] | |
defined trait Equals | |
scala> implicit def equals[A,B](implicit e: A =:= B):Equals[A,B] = null | |
equals: [A, B](implicit e: =:=[A,B])Equals[A,B] | |
scala> implicitly[Equals[String, Int]] | |
<console>:16: error: whoa there! String is not Int, buddy | |
implicitly[Equals[String, Int]] | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment