[FIR] Rewrite redeclaration checks

#KT-60124 Fixed
#KT-60573 Fixed
This commit is contained in:
Kirill Rakhman
2023-07-20 11:17:02 +02:00
committed by Space Team
parent b56f84b533
commit 951b299268
55 changed files with 1075 additions and 837 deletions
@@ -3,11 +3,11 @@
interface A
interface B
<!CONFLICTING_OVERLOADS!>context(A, B)
fun f(): Unit<!> = TODO()
context(A, B)
fun f(): Unit = TODO()
<!CONFLICTING_OVERLOADS!>context(B, A)
fun f(): Unit<!> = TODO()
context(B, A)
fun f(): Unit = TODO()
fun test(a: A, b: B) {
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>with<!>(a) {
@@ -1,20 +0,0 @@
// !LANGUAGE: +ContextReceivers
interface A
interface B
interface C
interface D
<!CONFLICTING_OVERLOADS!>context(A, B)
fun f(): Unit<!> = TODO()
<!CONFLICTING_OVERLOADS!>context(C, D)
fun f(): Unit<!> = TODO()
fun test(a: A, b: B) {
with(a) {
with(b) {
f()
}
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
interface A
@@ -4,7 +4,7 @@ class A<T>(val a: T)
class B(val b: Any)
class C(val c: Any)
<!MUST_BE_INITIALIZED!>context(A<String>, B) var <!REDECLARATION!>p<!>: Int<!>
<!MUST_BE_INITIALIZED!>context(A<String>, B) var p: Int<!>
get() {
this@A.a.length
this@B.b
@@ -18,7 +18,7 @@ class C(val c: Any)
field = value
}
<!MUST_BE_INITIALIZED!>context(A<Int>, A<String>, B) var <!REDECLARATION!>p<!>: Int<!>
<!MUST_BE_INITIALIZED!>context(A<Int>, A<String>, B) var p: Int<!>
get() {
this@A.a.<!UNRESOLVED_REFERENCE!>toDouble<!>()
this@A.a.length