Created
June 29, 2012 23:50
-
-
Save matthandlersux/3021478 to your computer and use it in GitHub Desktop.
scala question about traits and parameter access
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
object Test { | |
var list = List() | |
} | |
abstract class Test(parameter:String) { | |
} | |
trait TestTrait { | |
var parameter:String | |
Test.list = Test.list ++ List(parameter) | |
} | |
class SubTest extends Test("name") with TestTrait { | |
} | |
Test.list == List("name") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment