Created
May 1, 2013 05:57
-
-
Save ryoppy/5493954 to your computer and use it in GitHub Desktop.
traitで子のプロパティなど参照したいとき
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
abstract class Interface(_id: Int) { | |
def id: Int = _id | |
} | |
trait Like { | |
self : Interface => | |
def get: Int = this.id | |
} | |
trait Param { | |
self : Interface => | |
} | |
case class A(_id: Int) extends Interface(_id: Int) with Like with Param { | |
} | |
println(A(1).id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment