JET-18 Resolve references to value parameters of the primary constructor to parameter or property descriptors according to the semantics

This commit is contained in:
Andrey Breslav
2011-05-04 14:12:36 +04:00
parent dae06f0b67
commit ba221419b4
7 changed files with 137 additions and 48 deletions
@@ -0,0 +1,19 @@
class C(~x~x : Int, ~y~val y : Int) : Base(`x`x /*parameter*/), Base1 by new Base1(`x`x) {
var z = `x`x // parameter
get() = `$x`x // property
{
val z = `x`x // parameter
}
this() : this(1, 2) {
val z = x // inaccessible
val zz = `$y`y // property
}
fun f() : Int {
return `$x`x // property
}
}
@@ -1,12 +1,12 @@
class A(~a~val a : Int) {
this() {`a`a}
this() {`$a`a}
~b~val b = `a`a
~f~fun f() = `a`a
~f~fun f() = `$a`a
}
fun test() {
~va~val a = new A()
`va`a.`a`a`:std::Int`
`va`a.`$a`a`:std::Int`
a.`b`b`:std::Int`
a.`f`f()`:std::Int`
}