Skip to content

Instantly share code, notes, and snippets.

@jvshahid
Created December 27, 2011 20:45
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 jvshahid/1525066 to your computer and use it in GitHub Desktop.
Save jvshahid/1525066 to your computer and use it in GitHub Desktop.
Multiple implicits with the same name cause a compilation error
package bmrk.eod.parsing.examples.inference
import java.util.SortedMap
object Implicits {
implicit def implicitDef[T <: AnyRef](key:String,columns:SortedMap[String,String]) (implicit m:Manifest[T]):T = {
null.asInstanceOf[T]
}
// If the next method is removed this file will compile
implicit def implicitDef[T <: AnyRef](key:String,columns:List[(String,String)]) (implicit m:Manifest[T]): T = {
null.asInstanceOf[T]
}
}
class Test {
import Implicits._
def someMethod[S](implicit anotherMethod:(String,SortedMap[String,String]) => (Manifest[S]) => S) = {
anotherMethod(null, null)
}
val foo = someMethod[String]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment