Created
June 26, 2012 17:02
-
-
Save seraphr/2997138 to your computer and use it in GitHub Desktop.
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
// 間違ってたので書換 | |
// 自己参照する型引数を持つtraitを定義 | |
trait A[_E, _A <: A[_A]]{ | |
def m: _A = this.asInstanceOf[_A] | |
} | |
// mixin | |
class B[_E] extends A[_E, B[_E]] |
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
// Java側から、Bのmメソッドを呼び出すと、実行時にjava.lang.NoSuchMethodError | |
new B<String>().m(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment