This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Overloaded implicits

No replies
John Shahid
Joined: 2011-12-27,
User offline. Last seen 42 years 45 weeks ago.
Does anyone know of a problem with overloaded implicit methods ? Here's a gist with an example that doesn't compile (https://gist.github.com/1525066). I also pasted it below in case you cannot open the gist:

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] }

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland