Created
March 10, 2012 10:12
-
-
Save alphaneet/2011029 to your computer and use it in GitHub Desktop.
import magic!!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hoge { | |
case class A(str: String) { def run() = println("a dao: " + str) } | |
} | |
package object hoge { | |
implicit def strToA(str: String) = A(str) | |
} | |
object Main extends App { | |
import hoge._ | |
// import hoge.strToA // これでもいい | |
"hoge" run | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment