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:
@@ -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`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user