[FIR] Don't provide receiver as value in delegated constructor call
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ open class Base<T>(p: Any?) {
|
||||
|
||||
class D: Base<Int>("") {
|
||||
inner class B : Base<String> {
|
||||
constructor() : <!INAPPLICABLE_CANDIDATE!>super<!>(foo1(""))
|
||||
constructor() : <!INAPPLICABLE_CANDIDATE!>super<!>(<!INAPPLICABLE_CANDIDATE!>foo1<!>(""))
|
||||
constructor(x: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(foo1(1))
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ open class Base<T>(p: Any?) {
|
||||
class D: Base<Int>(1) {
|
||||
inner class B : Base<Int> {
|
||||
constructor() : <!INAPPLICABLE_CANDIDATE!>super<!>(foo1(1))
|
||||
constructor(x: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(this@B.foo1(1))
|
||||
constructor(x: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(this@B.<!UNRESOLVED_REFERENCE!>foo1<!>(1))
|
||||
constructor(x: Int, y: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(this@D.foo1(1))
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@ fun Base.foo() {
|
||||
class B : Base {
|
||||
constructor() : <!INAPPLICABLE_CANDIDATE!>super<!>(foo1())
|
||||
constructor(x: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(this@foo.foo1())
|
||||
constructor(x: Int, y: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(this@B.foo1())
|
||||
constructor(x: Int, y: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(this@B.<!UNRESOLVED_REFERENCE!>foo1<!>())
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ open class Base<T>(p: Any?) {
|
||||
|
||||
fun Base<Int>.foo() {
|
||||
class B : Base<String> {
|
||||
constructor() : <!INAPPLICABLE_CANDIDATE!>super<!>(foo1(""))
|
||||
constructor() : <!INAPPLICABLE_CANDIDATE!>super<!>(<!INAPPLICABLE_CANDIDATE!>foo1<!>(""))
|
||||
constructor(x: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(foo1(1))
|
||||
constructor(x: Int, y: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(this@foo.foo1(12))
|
||||
constructor(x: Int, y: Int, z: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(this@B.foo1(""))
|
||||
constructor(x: Int, y: Int, z: Int) : <!INAPPLICABLE_CANDIDATE!>super<!>(this@B.<!UNRESOLVED_REFERENCE!>foo1<!>(""))
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,5 +7,5 @@ class Outer {
|
||||
|
||||
constructor(x: Int)
|
||||
constructor(x: Int, y: Int, z: Int = x + Inner().prop + this.Inner().prop) :
|
||||
this(x + Inner().prop + this.Inner().prop)
|
||||
this(x + Inner().prop <!AMBIGUITY!>+<!> this.<!UNRESOLVED_REFERENCE!>Inner<!>().<!UNRESOLVED_REFERENCE!>prop<!>)
|
||||
}
|
||||
|
||||
Vendored
+4
-4
@@ -7,9 +7,9 @@ class A {
|
||||
constructor(x: () -> Int)
|
||||
constructor() : this(
|
||||
{
|
||||
foo() +
|
||||
this.foo() +
|
||||
this@A.foo() +
|
||||
foobar()
|
||||
<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
this.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
this@A.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
<!UNRESOLVED_REFERENCE!>foobar<!>()
|
||||
})
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -3,5 +3,5 @@ class A {
|
||||
fun foo() = 1
|
||||
constructor(x: Int)
|
||||
constructor(x: Int, y: Int, z: Int = x + foo() + this.foo()) :
|
||||
this(x + foo() + this.foo())
|
||||
<!INAPPLICABLE_CANDIDATE!>this<!>(x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>foo<!>() + this.<!UNRESOLVED_REFERENCE!>foo<!>())
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ class A {
|
||||
fun foo() = 1
|
||||
constructor(x: Any?)
|
||||
constructor() : this(object {
|
||||
fun bar() = foo() + this@A.foo() +
|
||||
foobar() + super@A.hashCode()
|
||||
fun bar() = <!UNRESOLVED_REFERENCE!>foo<!>() + this@A.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
<!INAPPLICABLE_CANDIDATE!>foobar<!>() + super@A.hashCode()
|
||||
})
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -4,8 +4,8 @@ class D : C {
|
||||
constructor() : <!INAPPLICABLE_CANDIDATE!>super<!>(
|
||||
{
|
||||
val s = ""
|
||||
s()
|
||||
""()
|
||||
<!UNRESOLVED_REFERENCE!>s<!>()
|
||||
<!UNRESOLVED_REFERENCE!>""()<!>
|
||||
42
|
||||
}())
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -3,5 +3,5 @@ class A {
|
||||
val prop = 1
|
||||
constructor(x: Int)
|
||||
constructor(x: Int, y: Int, z: Int = x + prop + this.prop) :
|
||||
this(x + prop + this.prop)
|
||||
<!INAPPLICABLE_CANDIDATE!>this<!>(x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>prop<!> + this.<!UNRESOLVED_REFERENCE!>prop<!>)
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,5 +3,5 @@ open class B(x: Int)
|
||||
class A : B {
|
||||
val prop = 1
|
||||
constructor(x: Int, y: Int = x + prop + this.prop) :
|
||||
<!INAPPLICABLE_CANDIDATE!>super<!>(x + prop + this.prop)
|
||||
<!INAPPLICABLE_CANDIDATE!>super<!>(x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>prop<!> + this.<!UNRESOLVED_REFERENCE!>prop<!>)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -4,5 +4,5 @@ open class B(x: Int) {
|
||||
}
|
||||
class A : B {
|
||||
constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) :
|
||||
<!INAPPLICABLE_CANDIDATE!>super<!>(x + foo() + this.foo() + super.foo())
|
||||
<!INAPPLICABLE_CANDIDATE!>super<!>(x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>foo<!>() + this.<!UNRESOLVED_REFERENCE!>foo<!>() + super.foo())
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,5 +5,5 @@ open class B(x: Int) {
|
||||
class A : B {
|
||||
override fun foo() = 2
|
||||
constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) :
|
||||
<!INAPPLICABLE_CANDIDATE!>super<!>(x + foo() + this.foo() + super.foo())
|
||||
<!INAPPLICABLE_CANDIDATE!>super<!>(x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>foo<!>() + this.<!UNRESOLVED_REFERENCE!>foo<!>() + super.foo())
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
open class B(val prop: Int)
|
||||
class A : B {
|
||||
constructor(x: Int, y: Int = x + prop + this.prop + super.prop) :
|
||||
<!INAPPLICABLE_CANDIDATE!>super<!>(x + prop + this.prop + super.prop)
|
||||
<!INAPPLICABLE_CANDIDATE!>super<!>(x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>prop<!> + this.<!UNRESOLVED_REFERENCE!>prop<!> + super.prop)
|
||||
}
|
||||
|
||||
+3
-3
@@ -5,10 +5,10 @@ val A.prop: Int get() = 2
|
||||
|
||||
class A {
|
||||
constructor(x: Int)
|
||||
constructor() : this(
|
||||
foobar() +
|
||||
constructor() : <!INAPPLICABLE_CANDIDATE!>this<!>(
|
||||
<!UNRESOLVED_REFERENCE!>foobar<!>() +
|
||||
this.foobar() +
|
||||
prop +
|
||||
<!UNRESOLVED_REFERENCE!>prop<!> +
|
||||
this.prop +
|
||||
this@A.prop
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user