Created
May 21, 2010 06:37
-
-
Save teaplanet/408540 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 imp.param | |
| /** | |
| * 継承するだけで暗黙値を利用したかった・・・。 | |
| */ | |
| case class Dad { | |
| var mom:Mom = Mom() | |
| implicit def call(name:String)(implicit mom:Mom):Unit = {} | |
| } | |
| case class Mom | |
| case class Me extends Dad { | |
| call("Taro")(mom) // OK | |
| // call("Taro") // NG | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment