Created
December 6, 2016 08:56
-
-
Save Shinpeim/922d0747a0655121d60cb6e2da2ebf64 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
class ComponentBuilder[X](a: X, b:X) { | |
class ClassA[X](val v: X) | |
class ClassB[X](val v: X) | |
def buildA = new ClassA(a) | |
def buildB = new ClassB(b) | |
} | |
val b = new ComponentBuilder[Int](1, 2) | |
println(b.buildA.v) // 1 | |
println(b.buildB.v) // 2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment