Created
October 23, 2015 18:24
-
-
Save andrewconner/932c743104659a0625e7 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 Parent { | |
val a = 1 | |
val b = a | |
} | |
class Kid extends Parent { | |
override val a = 100 | |
} | |
new Kid().b // == 0 | |
new Kid().a // == 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Two easy solutions, depending on your needs: