Created
November 1, 2014 21:22
-
-
Save rxin/6be132f46b72c27d8f89 to your computer and use it in GitHub Desktop.
test.scala on constructor parameter shadowing
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 LegalPerson(name: String) { | |
def aaaaaaaaaa = name | |
} | |
class DoomedPerson(name: String) extends LegalPerson(name) { | |
def curName = name | |
} | |
class AAAAA(val xxxx: Int) | |
class BBBBBB(xxxx: Int) extends AAAAA(xxxx) { | |
def ppppp() { println(xxxx) } | |
} | |
[[syntax trees at end of cleanup]] // test.scala | |
package <empty> { | |
class LegalPerson extends Object { | |
<paramaccessor> private[this] val name: String = _; | |
def aaaaaaaaaa(): String = LegalPerson.this.name; | |
def <init>(name: String): LegalPerson = { | |
LegalPerson.this.name = name; | |
LegalPerson.super.<init>(); | |
() | |
} | |
}; | |
class DoomedPerson extends LegalPerson { | |
<paramaccessor> private[this] val name: String = _; | |
def curName(): String = DoomedPerson.this.name; | |
def <init>(name: String): DoomedPerson = { | |
DoomedPerson.this.name = name; | |
DoomedPerson.super.<init>(name); | |
() | |
} | |
}; | |
class AAAAA extends Object { | |
<paramaccessor> private[this] val xxxx: Int = _; | |
<stable> <accessor> <paramaccessor> def xxxx(): Int = AAAAA.this.xxxx; | |
def <init>(xxxx: Int): AAAAA = { | |
AAAAA.this.xxxx = xxxx; | |
AAAAA.super.<init>(); | |
() | |
} | |
}; | |
class BBBBBB extends AAAAA { | |
def ppppp(): Unit = scala.this.Predef.println(scala.Int.box((BBBBBB.super.xxxx(): Int))); | |
def <init>(xxxx: Int): BBBBBB = { | |
BBBBBB.super.<init>(xxxx); | |
() | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment