Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarhart/3021499 to your computer and use it in GitHub Desktop.
Save jarhart/3021499 to your computer and use it in GitHub Desktop.
scala question about traits and parameter access
object Test {
var list = List()
}
abstract class Test(protected val parameter:String) {
}
trait TestTrait { self: Test =>
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