Skip to content

Instantly share code, notes, and snippets.

@paulp
Created June 22, 2012 03:27
Show Gist options
  • Save paulp/2970006 to your computer and use it in GitHub Desktop.
Save paulp/2970006 to your computer and use it in GitHub Desktop.
repl implicits fun
scala> class A[T] { implicit def f(x: T): List[T] = Nil }
warning: there were 1 feature warnings; re-run with -feature for details
defined class A
scala> implicits[A[Int]].conversions >
implicit def f(x: Int): scala.List[Int]
scala> implicits[Predef.type].from[Int] >
implicit def int2IntegerConflict(x: Int): Object
implicit def int2Integer(x: Int): Integer
implicit def intWrapper(x: Int): scala.runtime.RichInt
scala> implicits[Predef.type].to[Int] >
implicit def Integer2int(x: Integer): Int
implicit def Integer2intNullConflict(x: Null): Int
scala> implicits[Predef.type].matching[String => Any] >
implicit def augmentString(x: scala.Predef.String): scala.collection.immutable.StringOps
implicit def wrapString(s: scala.Predef.String): scala.collection.immutable.WrappedString
@mergeconflict
Copy link

needs more bippy

@asflierl
Copy link

niiice :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment