[FIR] add reversed testData to update it in the next commit
^KT-56543
This commit is contained in:
committed by
Space Team
parent
cc52e896f9
commit
1c5aa6c45b
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_REVERSED_RESOLVE
|
||||
fun <T, R> use(x: (T) -> R): (T) -> R = x
|
||||
|
||||
fun foo() = use(::bar)
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
FILE: implicitTypes.kt
|
||||
public final fun <T, R> use(x: R|(T) -> R|): R|(T) -> R| {
|
||||
^use R|<local>/x|
|
||||
}
|
||||
public final fun foo(): R|(kotlin/String) -> kotlin/Int| {
|
||||
^foo R|/use|<R|kotlin/String|, R|kotlin/Int|>(::R|/bar|)
|
||||
}
|
||||
public final fun bar(x: R|kotlin/String|): R|kotlin/Int| {
|
||||
^bar Int(1)
|
||||
}
|
||||
public final fun loop1(): R|(ERROR CLASS: Cannot infer argument for type parameter T) -> ERROR CLASS: Cannot infer argument for type parameter R| {
|
||||
^loop1 R|/use<Inapplicable(INAPPLICABLE): /use>#|<<ERROR TYPE REF: Cannot infer argument for type parameter T>, <ERROR TYPE REF: Cannot infer argument for type parameter R>>(::<Unresolved reference: loop2>#)
|
||||
}
|
||||
public final fun loop2(): <ERROR TYPE REF: cycle> {
|
||||
^loop2 R|/loop1|()
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
fun <T, R> use(x: (T) -> R): (T) -> R = x
|
||||
|
||||
fun foo() = use(::bar)
|
||||
fun bar(x: String) = 1
|
||||
|
||||
fun loop1() = <!INAPPLICABLE_CANDIDATE!>use<!>(::<!UNRESOLVED_REFERENCE!>loop2<!>)
|
||||
fun loop2() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>loop1()<!>
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_REVERSED_RESOLVE
|
||||
// MODULE: lib
|
||||
// FILE: A.kt
|
||||
|
||||
|
||||
+45
@@ -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))
|
||||
}
|
||||
+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
@@ -1,4 +1,3 @@
|
||||
// IGNORE_REVERSED_RESOLVE
|
||||
val items: List<String>
|
||||
field = mutableListOf()
|
||||
|
||||
|
||||
+7
@@ -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))
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
val items: List<String>
|
||||
field = mutableListOf()
|
||||
|
||||
fun test() {
|
||||
items.add("one more item")
|
||||
}
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_REVERSED_RESOLVE
|
||||
val list: List<String>
|
||||
field = mutableListOf<String>()
|
||||
|
||||
|
||||
+7
@@ -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|)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
val list: List<String>
|
||||
field = mutableListOf<String>()
|
||||
|
||||
fun add(s: String) {
|
||||
list.add(s)
|
||||
}
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_REVERSED_RESOLVE
|
||||
class A {
|
||||
val it: Number
|
||||
field = 4
|
||||
|
||||
+25
@@ -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))
|
||||
}
|
||||
+15
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user