Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

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