Created
May 21, 2010 06:40
-
-
Save teaplanet/408542 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 | |
| /** | |
| * traitを継承するだけで暗黙に利用したかったが無理か・・・。 | |
| */ | |
| case class Dad2 { | |
| var bros:Bros = Bros() | |
| } | |
| trait Mom2 { | |
| implicit def call(name:String)(implicit bros:Bros):Unit = {} | |
| } | |
| case class Bros | |
| case class Me2 extends Dad2 with Mom2 { | |
| call("Taro")(bros) // OK | |
| // call("Taro") // NG | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment