[FIR] Correctly build scopes for resolve of different parts of constructors
#KT-40409 Fixed
This commit is contained in:
+1
-1
@@ -6,6 +6,6 @@ class Outer {
|
||||
}
|
||||
|
||||
constructor(x: Int)
|
||||
constructor(x: Int, y: Int, z: Int = x + Inner().prop + this.Inner().prop) :
|
||||
constructor(x: Int, y: Int, z: Int = x + Inner().prop <!AMBIGUITY!>+<!> this.<!UNRESOLVED_REFERENCE!>Inner<!>().<!UNRESOLVED_REFERENCE!>prop<!>) :
|
||||
this(x + Inner().prop + this.Inner().prop)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -2,6 +2,6 @@
|
||||
class A {
|
||||
fun foo() = 1
|
||||
constructor(x: Int)
|
||||
constructor(x: Int, y: Int, z: Int = x + foo() + this.foo()) :
|
||||
constructor(x: Int, y: Int, z: Int = x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>foo<!>() + this.<!UNRESOLVED_REFERENCE!>foo<!>()) :
|
||||
this(x + foo() + this.foo())
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ fun A.foobar() = 3
|
||||
class A {
|
||||
fun foo() = 1
|
||||
constructor( x: Any = object {
|
||||
fun bar() = foo() + this@A.foo() +
|
||||
foobar()
|
||||
fun bar() = <!UNRESOLVED_REFERENCE!>foo<!>() + this@A.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
<!INAPPLICABLE_CANDIDATE!>foobar<!>()
|
||||
})
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -2,6 +2,6 @@
|
||||
class A {
|
||||
val prop = 1
|
||||
constructor(x: Int)
|
||||
constructor(x: Int, y: Int, z: Int = x + prop + this.prop) :
|
||||
constructor(x: Int, y: Int, z: Int = x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>prop<!> + this.<!UNRESOLVED_REFERENCE!>prop<!>) :
|
||||
this(x + prop + this.prop)
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
open class B(x: Int)
|
||||
class A : B {
|
||||
val prop = 1
|
||||
constructor(x: Int, y: Int = x + prop + this.prop) :
|
||||
constructor(x: Int, y: Int = x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>prop<!> + this.<!UNRESOLVED_REFERENCE!>prop<!>) :
|
||||
super(x + prop + this.prop)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -3,6 +3,6 @@ open class B(x: Int) {
|
||||
fun foo() = 1
|
||||
}
|
||||
class A : B {
|
||||
constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) :
|
||||
constructor(x: Int, y: Int = x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>foo<!>() + this.<!UNRESOLVED_REFERENCE!>foo<!>() + super.<!UNRESOLVED_REFERENCE!>foo<!>()) :
|
||||
super(x + foo() + this.foo() + super.foo())
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ open class B(x: Int) {
|
||||
}
|
||||
class A : B {
|
||||
override fun foo() = 2
|
||||
constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) :
|
||||
constructor(x: Int, y: Int = x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>foo<!>() + this.<!UNRESOLVED_REFERENCE!>foo<!>() + super.<!UNRESOLVED_REFERENCE!>foo<!>()) :
|
||||
super(x + foo() + this.foo() + super.foo())
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
open class B(val prop: Int)
|
||||
class A : B {
|
||||
constructor(x: Int, y: Int = x + prop + this.prop + super.prop) :
|
||||
constructor(x: Int, y: Int = x <!AMBIGUITY!>+<!> <!UNRESOLVED_REFERENCE!>prop<!> + this.<!UNRESOLVED_REFERENCE!>prop<!> + super.<!UNRESOLVED_REFERENCE!>prop<!>) :
|
||||
super(x + prop + this.prop + super.prop)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user