[FIR] add reversed testData to update it in the next commit

^KT-56543
This commit is contained in:
Dmitrii Gridin
2023-04-05 08:55:16 +02:00
committed by Space Team
parent cc52e896f9
commit 1c5aa6c45b
62 changed files with 695 additions and 36 deletions
@@ -1,4 +1,3 @@
// IGNORE_REVERSED_RESOLVE
// MODULE: lib
// FILE: A.kt
@@ -0,0 +1,45 @@
Module: lib
FILE: A.kt
public final class A : R|kotlin/Any| {
public constructor(): R|A| {
super<R|kotlin/Any|>()
}
public final val a: R|kotlin/Number|
private <explicit backing field>: R|kotlin/Int| = Int(1)
public get(): R|kotlin/Number|
public final val b: R|kotlin/Number|
internal <explicit backing field>: R|kotlin/Int| = Int(2)
public get(): R|kotlin/Number|
public final val c: R|kotlin/Number|
protected <explicit backing field>: R|kotlin/Int| = Int(3)
public get(): R|kotlin/Number|
public final val d: R|kotlin/Number|
public <explicit backing field>: R|kotlin/Int| = Int(5)
public get(): R|kotlin/Number|
public final fun rest(): R|kotlin/Unit| {
lval aI: R|kotlin/Int| = R|/A.A|().R|/A.a|.R|kotlin/Int.plus|(Int(10))
lval bI: R|kotlin/Int| = R|/A.A|().R|/A.b|.R|kotlin/Int.plus|(Int(20))
lval cI: <ERROR TYPE REF: Unresolved name: plus> = R|/A.A|().R|/A.c|.<Unresolved name: plus>#(Int(30))
lval dI: <ERROR TYPE REF: Unresolved name: plus> = R|/A.A|().R|/A.d|.<Unresolved name: plus>#(Int(40))
}
}
public final fun test(): R|kotlin/Unit| {
lval aA: <ERROR TYPE REF: Unresolved name: plus> = R|/A.A|().R|/A.a|.<Unresolved name: plus>#(Int(10))
lval bA: R|kotlin/Int| = R|/A.A|().R|/A.b|.R|kotlin/Int.plus|(Int(20))
lval cA: <ERROR TYPE REF: Unresolved name: plus> = R|/A.A|().R|/A.c|.<Unresolved name: plus>#(Int(30))
lval dA: <ERROR TYPE REF: Unresolved name: plus> = R|/A.A|().R|/A.d|.<Unresolved name: plus>#(Int(40))
}
Module: main
FILE: B.kt
public final fun main(): R|kotlin/Unit| {
lval aB: <ERROR TYPE REF: Unresolved name: plus> = R|/A.A|().R|/A.a|.<Unresolved name: plus>#(Int(10))
lval bB: <ERROR TYPE REF: Unresolved name: plus> = R|/A.A|().R|/A.b|.<Unresolved name: plus>#(Int(20))
lval cB: <ERROR TYPE REF: Unresolved name: plus> = R|/A.A|().R|/A.c|.<Unresolved name: plus>#(Int(30))
lval dB: <ERROR TYPE REF: Unresolved name: plus> = R|/A.A|().R|/A.d|.<Unresolved name: plus>#(Int(40))
}
@@ -0,0 +1,40 @@
// MODULE: lib
// FILE: A.kt
class A {
val a: Number
private field = 1
val b: Number
internal field = 2
val c: Number
<!WRONG_MODIFIER_TARGET!>protected<!> field = 3
val d: Number
<!WRONG_MODIFIER_TARGET!>public<!> field = 5
fun rest() {
val aI = A().a + 10
val bI = A().b + 20
val cI = A().c <!UNRESOLVED_REFERENCE!>+<!> 30
val dI = A().d <!UNRESOLVED_REFERENCE!>+<!> 40
}
}
fun test() {
val aA = A().a <!UNRESOLVED_REFERENCE!>+<!> 10
val bA = A().b + 20
val cA = A().c <!UNRESOLVED_REFERENCE!>+<!> 30
val dA = A().d <!UNRESOLVED_REFERENCE!>+<!> 40
}
// MODULE: main(lib)
// FILE: B.kt
fun main() {
val aB = A().a <!UNRESOLVED_REFERENCE!>+<!> 10
val bB = A().b <!UNRESOLVED_REFERENCE!>+<!> 20
val cB = A().c <!UNRESOLVED_REFERENCE!>+<!> 30
val dB = A().d <!UNRESOLVED_REFERENCE!>+<!> 40
}
@@ -1,4 +1,3 @@
// IGNORE_REVERSED_RESOLVE
val items: List<String>
field = mutableListOf()
@@ -0,0 +1,7 @@
FILE: backingFieldWithSmartTypeParameters.kt
public final val items: R|kotlin/collections/List<kotlin/String>|
private <explicit backing field>: R|kotlin/collections/MutableList<kotlin/String>| = R|kotlin/collections/mutableListOf|<R|kotlin/String|>()
public get(): R|kotlin/collections/List<kotlin/String>|
public final fun test(): R|kotlin/Unit| {
R|/items|.R|SubstitutionOverride<kotlin/collections/MutableList.add: R|kotlin/Boolean|>|(String(one more item))
}
@@ -0,0 +1,6 @@
val items: List<String>
field = mutableListOf()
fun test() {
items.add("one more item")
}
@@ -1,4 +1,3 @@
// IGNORE_REVERSED_RESOLVE
val list: List<String>
field = mutableListOf<String>()
@@ -0,0 +1,7 @@
FILE: filePrivateBackingFieldAccess.kt
public final val list: R|kotlin/collections/List<kotlin/String>|
private <explicit backing field>: R|kotlin/collections/MutableList<kotlin/String>| = R|kotlin/collections/mutableListOf|<R|kotlin/String|>()
public get(): R|kotlin/collections/List<kotlin/String>|
public final fun add(s: R|kotlin/String|): R|kotlin/Unit| {
R|/list|.R|SubstitutionOverride<kotlin/collections/MutableList.add: R|kotlin/Boolean|>|(R|<local>/s|)
}
@@ -0,0 +1,6 @@
val list: List<String>
field = mutableListOf<String>()
fun add(s: String) {
list.add(s)
}
@@ -1,4 +1,3 @@
// IGNORE_REVERSED_RESOLVE
class A {
val it: Number
field = 4
@@ -0,0 +1,25 @@
FILE: propertyTypeNarrowing.kt
public final class A : R|kotlin/Any| {
public constructor(): R|A| {
super<R|kotlin/Any|>()
}
public final val it: R|kotlin/Number|
private <explicit backing field>: R|kotlin/Int| = Int(4)
public get(): R|kotlin/Number|
public final fun test(): R|kotlin/Int| {
^test this@R|/A|.R|/A.it|.R|kotlin/Int.plus|(Int(3))
}
public final val p: R|kotlin/Int| = Int(5)
public get(): R|kotlin/Int| {
^ this@R|/A|.F|/A.p|
}
}
public final fun test(): R|kotlin/Unit| {
lval c: <ERROR TYPE REF: Unresolved name: plus> = R|/A.A|().R|/A.it|.<Unresolved name: plus>#(Int(1))
lval d: R|kotlin/Unit| = R|/test|()
lval b: R|kotlin/Int| = R|/A.A|().R|/A.p|.R|kotlin/Int.plus|(Int(2))
}
@@ -0,0 +1,15 @@
class A {
val it: Number
field = 4
fun test() = it + 3
val p = 5
get() = field
}
fun test() {
val c = A().it <!UNRESOLVED_REFERENCE!>+<!> 1
val d = test()
val b = A().p + 2
}