Skip to content

Instantly share code, notes, and snippets.

@NobukazuHanada
Created February 21, 2017 05:12
Show Gist options
  • Save NobukazuHanada/9046ef67f363de82e7cd5854d676652c to your computer and use it in GitHub Desktop.
Save NobukazuHanada/9046ef67f363de82e7cd5854d676652c to your computer and use it in GitHub Desktop.
object Main extends App{
class Hoge
def createValue : Hoge = new Hoge
implicit def toInt(x:Hoge) : Int = 3
implicit def toString(x:Hoge) : String = "pa"
val a : Int = createValue
println(a)
val b : String = createValue
println(b)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment