Skip to content

Instantly share code, notes, and snippets.

@teaplanet
Created May 21, 2010 06:40
Show Gist options
  • Select an option

  • Save teaplanet/408542 to your computer and use it in GitHub Desktop.

Select an option

Save teaplanet/408542 to your computer and use it in GitHub Desktop.
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