Created
June 14, 2012 00:30
-
-
Save rabitarochan/2927368 to your computer and use it in GitHub Desktop.
implicitをまだ理解しきれてない
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
object Test { | |
implicit def int2String(x: Int): String = x.toString | |
} | |
// defined module Test | |
import Test._ | |
val num = 123 | |
num.mkString("\n") | |
// error: value mkString is not a member of Int |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment