[FIR] Don't provide receiver as value in delegated constructor call

This commit is contained in:
Mikhail Glukhikh
2020-03-31 13:10:37 +03:00
parent a377a6fccb
commit 630adb34db
35 changed files with 78 additions and 69 deletions
@@ -37,8 +37,8 @@ class A(
Companion.CONST,
Nested.CONST,
Interface.CONST,
a,
b()
<!UNRESOLVED_REFERENCE!>a<!>,
<!UNRESOLVED_REFERENCE!>b<!>()
)
class Nested {
@@ -1,8 +0,0 @@
open class S(val a: Any, val b: Any, val c: Any) {}
object A : S(prop1, prop2, func()) {
val prop1 = 1
val prop2: Int
get() = 1
fun func() {}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
open class S(val a: Any, val b: Any, val c: Any) {}
object A : S(<!UNRESOLVED_REFERENCE!>prop1<!>, <!UNRESOLVED_REFERENCE!>prop2<!>, <!UNRESOLVED_REFERENCE!>func<!>()) {
@@ -20,8 +20,8 @@ class A : S (
Companion.CONST,
Nested.CONST,
Interface.CONST,
a,
b()
<!UNRESOLVED_REFERENCE!>a<!>,
<!UNRESOLVED_REFERENCE!>b<!>()
) {
class Nested {
@@ -22,8 +22,8 @@ class A : S {
Companion.CONST,
Nested.CONST,
Interface.CONST,
a,
b()
<!UNRESOLVED_REFERENCE!>a<!>,
<!UNRESOLVED_REFERENCE!>b<!>()
)
class Nested {
@@ -5,7 +5,7 @@ import java.util.HashMap
//KT-250 Incorrect variable resolve in constructor arguments of superclass
open class A(val x: Int)
class B(y: Int) : A(x) //x is resolved as a property in a, so no error is generated
class B(y: Int) : A(<!UNRESOLVED_REFERENCE!>x<!>) //x is resolved as a property in a, so no error is generated
//KT-617 Prohibit dollars in call to superclass constructors
open class M(p: Int)
@@ -29,9 +29,9 @@ abstract class TagWithText(name : String) : Tag(name) {
open class BodyTag(name : String) : TagWithText(name) {
}
class Body() : BodyTag(name) { // Must be an error!
class Body() : BodyTag(<!UNRESOLVED_REFERENCE!>name<!>) { // Must be an error!
}
class Body1() : BodyTag(this.name) { // Must be an error!
class Body1() : BodyTag(this.<!UNRESOLVED_REFERENCE!>name<!>) { // Must be an error!
}
//more tests
@@ -40,10 +40,10 @@ open class X(p: Int, r: Int) {
val s = "s"
}
class Y(i: Int) : X(i, rrr) {
class Y(i: Int) : X(i, <!UNRESOLVED_REFERENCE!>rrr<!>) {
val rrr = 3
}
class Z(val i: Int) : <!INAPPLICABLE_CANDIDATE!>X<!>(s, x) {
class Z(val i: Int) : X(<!UNRESOLVED_REFERENCE!>s<!>, <!UNRESOLVED_REFERENCE!>x<!>) {
val x = 2
}