Skip to content

Instantly share code, notes, and snippets.

@stephenjudkins
Created December 7, 2012 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephenjudkins/4230122 to your computer and use it in GitHub Desktop.
Save stephenjudkins/4230122 to your computer and use it in GitHub Desktop.
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