[FIR] Do not include transitive friend dependencies in symbol provider
When flattening a dependency FirSymbolProvider, make sure transitive dependency FirSymbolProviders are not included. This requires checking that nested symbol provider sessions match the composite symbol provider session when they are both source sessions. ^KT-60614 Fixed
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ FILE fqName:b fileName:/b.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun foo (f: kotlin.Function0<kotlin.String>): kotlin.String declared in b'
|
||||
CALL 'public abstract fun invoke (): R of kotlin.Function0 declared in kotlin.Function0' type=kotlin.String origin=INVOKE
|
||||
$this: GET_VAR 'f: kotlin.Function0<kotlin.String> declared in b.foo' type=kotlin.Function0<kotlin.String> origin=VARIABLE_AS_FUNCTION
|
||||
Module: c
|
||||
Module: main
|
||||
FILE fqName:<root> fileName:/c.kt
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// DUMP_IR
|
||||
// This test checks that unresolved typealias in an abbreviated type does not crash the compiler or result in a compilation error.
|
||||
// Apparently, there's some demand for this behavior, see KT-45308, KT-58335.
|
||||
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// MODULE: m1
|
||||
// FILE: a.kt
|
||||
|
||||
package p
|
||||
|
||||
public class A {
|
||||
public val propPublic = A()
|
||||
internal val propInternal = A()
|
||||
private val propPrivate = A()
|
||||
public fun funPublic() = A()
|
||||
internal fun funInternal() = A()
|
||||
private fun funPrivate() = A()
|
||||
public inner class ClassPublic
|
||||
internal inner class ClassInternal
|
||||
private inner class ClassPrivate
|
||||
}
|
||||
|
||||
public val propPublic = A()
|
||||
internal val propInternal = A()
|
||||
private val propPrivate = A()
|
||||
public fun funPublic() = A()
|
||||
internal fun funInternal() = A()
|
||||
private fun funPrivate() = A()
|
||||
public class ClassPublic
|
||||
internal class ClassInternal
|
||||
private class ClassPrivate
|
||||
|
||||
// MODULE: m2(m1)
|
||||
// FILE: b.kt
|
||||
|
||||
import p.*
|
||||
|
||||
fun test2() {
|
||||
propPublic
|
||||
<!INVISIBLE_REFERENCE!>propInternal<!>
|
||||
<!INVISIBLE_REFERENCE!>propPrivate<!>
|
||||
funPublic()
|
||||
<!INVISIBLE_REFERENCE!>funInternal<!>()
|
||||
<!INVISIBLE_REFERENCE!>funPrivate<!>()
|
||||
ClassPublic()
|
||||
<!INVISIBLE_REFERENCE!>ClassInternal<!>()
|
||||
<!INVISIBLE_REFERENCE!>ClassPrivate<!>()
|
||||
|
||||
val inst = A()
|
||||
inst.propPublic
|
||||
inst.<!INVISIBLE_REFERENCE!>propInternal<!>
|
||||
inst.<!INVISIBLE_REFERENCE!>propPrivate<!>
|
||||
inst.funPublic()
|
||||
inst.<!INVISIBLE_REFERENCE!>funInternal<!>()
|
||||
inst.<!INVISIBLE_REFERENCE!>funPrivate<!>()
|
||||
inst.ClassPublic()
|
||||
inst.<!INVISIBLE_REFERENCE!>ClassInternal<!>()
|
||||
inst.<!INVISIBLE_REFERENCE!>ClassPrivate<!>()
|
||||
}
|
||||
|
||||
// MODULE: m3(m2)
|
||||
// FILE: c.kt
|
||||
|
||||
import <!UNRESOLVED_IMPORT!>p<!>.*
|
||||
|
||||
fun test3() {
|
||||
<!UNRESOLVED_REFERENCE!>propPublic<!>
|
||||
<!UNRESOLVED_REFERENCE!>propInternal<!>
|
||||
<!UNRESOLVED_REFERENCE!>propPrivate<!>
|
||||
<!UNRESOLVED_REFERENCE!>funPublic<!>()
|
||||
<!UNRESOLVED_REFERENCE!>funInternal<!>()
|
||||
<!UNRESOLVED_REFERENCE!>funPrivate<!>()
|
||||
<!UNRESOLVED_REFERENCE!>ClassPublic<!>()
|
||||
<!UNRESOLVED_REFERENCE!>ClassInternal<!>()
|
||||
<!UNRESOLVED_REFERENCE!>ClassPrivate<!>()
|
||||
|
||||
val inst = <!UNRESOLVED_REFERENCE!>A<!>()
|
||||
inst.propPublic
|
||||
inst.propInternal
|
||||
inst.propPrivate
|
||||
inst.funPublic()
|
||||
inst.funInternal()
|
||||
inst.funPrivate()
|
||||
inst.ClassPublic()
|
||||
inst.ClassInternal()
|
||||
inst.ClassPrivate()
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// MODULE: m1
|
||||
// FILE: a.kt
|
||||
|
||||
package p
|
||||
|
||||
public class A {
|
||||
public val propPublic = A()
|
||||
internal val propInternal = A()
|
||||
private val propPrivate = A()
|
||||
public fun funPublic() = A()
|
||||
internal fun funInternal() = A()
|
||||
private fun funPrivate() = A()
|
||||
public inner class ClassPublic
|
||||
internal inner class ClassInternal
|
||||
private inner class ClassPrivate
|
||||
}
|
||||
|
||||
public val propPublic = A()
|
||||
internal val propInternal = A()
|
||||
private val propPrivate = A()
|
||||
public fun funPublic() = A()
|
||||
internal fun funInternal() = A()
|
||||
private fun funPrivate() = A()
|
||||
public class ClassPublic
|
||||
internal class ClassInternal
|
||||
private class ClassPrivate
|
||||
|
||||
// MODULE: m2(m1)
|
||||
// FILE: b.kt
|
||||
|
||||
import p.*
|
||||
|
||||
fun test2() {
|
||||
propPublic
|
||||
<!INVISIBLE_MEMBER!>propInternal<!>
|
||||
<!INVISIBLE_MEMBER!>propPrivate<!>
|
||||
funPublic()
|
||||
<!INVISIBLE_MEMBER!>funInternal<!>()
|
||||
<!INVISIBLE_MEMBER!>funPrivate<!>()
|
||||
ClassPublic()
|
||||
<!INVISIBLE_MEMBER!>ClassInternal<!>()
|
||||
<!INVISIBLE_MEMBER!>ClassPrivate<!>()
|
||||
|
||||
val inst = A()
|
||||
inst.propPublic
|
||||
inst.<!INVISIBLE_MEMBER!>propInternal<!>
|
||||
inst.<!INVISIBLE_MEMBER!>propPrivate<!>
|
||||
inst.funPublic()
|
||||
inst.<!INVISIBLE_MEMBER!>funInternal<!>()
|
||||
inst.<!INVISIBLE_MEMBER!>funPrivate<!>()
|
||||
inst.ClassPublic()
|
||||
inst.<!INVISIBLE_MEMBER!>ClassInternal<!>()
|
||||
inst.<!INVISIBLE_MEMBER!>ClassPrivate<!>()
|
||||
}
|
||||
|
||||
// MODULE: m3(m2)
|
||||
// FILE: c.kt
|
||||
|
||||
import <!UNRESOLVED_REFERENCE!>p<!>.*
|
||||
|
||||
fun test3() {
|
||||
<!UNRESOLVED_REFERENCE!>propPublic<!>
|
||||
<!UNRESOLVED_REFERENCE!>propInternal<!>
|
||||
<!UNRESOLVED_REFERENCE!>propPrivate<!>
|
||||
<!UNRESOLVED_REFERENCE!>funPublic<!>()
|
||||
<!UNRESOLVED_REFERENCE!>funInternal<!>()
|
||||
<!UNRESOLVED_REFERENCE!>funPrivate<!>()
|
||||
<!UNRESOLVED_REFERENCE!>ClassPublic<!>()
|
||||
<!UNRESOLVED_REFERENCE!>ClassInternal<!>()
|
||||
<!UNRESOLVED_REFERENCE!>ClassPrivate<!>()
|
||||
|
||||
val inst = <!UNRESOLVED_REFERENCE!>A<!>()
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>propPublic<!>
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>propInternal<!>
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>propPrivate<!>
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>funPublic<!>()
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>funInternal<!>()
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>funPrivate<!>()
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>ClassPublic<!>()
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>ClassInternal<!>()
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>ClassPrivate<!>()
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// MODULE: m1
|
||||
// FILE: a.kt
|
||||
|
||||
package p
|
||||
|
||||
public class A {
|
||||
internal val a = A()
|
||||
internal var v = A()
|
||||
internal fun a() = A()
|
||||
internal inner class B
|
||||
}
|
||||
|
||||
internal val a = A()
|
||||
internal var v = A()
|
||||
internal fun a() = A()
|
||||
internal class B
|
||||
|
||||
// MODULE: m2()(m1)
|
||||
// FILE: b.kt
|
||||
|
||||
import p.*
|
||||
|
||||
fun test() {
|
||||
val _a = a
|
||||
val _v = v
|
||||
a()
|
||||
B()
|
||||
|
||||
val inst = A()
|
||||
val ia = inst.a
|
||||
val iv = inst.v
|
||||
inst.a()
|
||||
inst.B()
|
||||
}
|
||||
|
||||
// MODULE: m3()(m2)
|
||||
// FILE: c.kt
|
||||
|
||||
import <!UNRESOLVED_IMPORT!>p<!>.*
|
||||
|
||||
fun test3() {
|
||||
val _a = <!UNRESOLVED_REFERENCE!>a<!>
|
||||
val _v = <!UNRESOLVED_REFERENCE!>v<!>
|
||||
<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
<!UNRESOLVED_REFERENCE!>B<!>()
|
||||
|
||||
val inst = <!UNRESOLVED_REFERENCE!>A<!>()
|
||||
val ia = inst.a
|
||||
val iv = inst.v
|
||||
inst.a()
|
||||
inst.B()
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// MODULE: m1
|
||||
// FILE: a.kt
|
||||
@@ -35,3 +34,20 @@ fun test() {
|
||||
inst.B()
|
||||
}
|
||||
|
||||
// MODULE: m3()(m2)
|
||||
// FILE: c.kt
|
||||
|
||||
import <!UNRESOLVED_REFERENCE!>p<!>.*
|
||||
|
||||
fun test3() {
|
||||
val _a = <!UNRESOLVED_REFERENCE!>a<!>
|
||||
val _v = <!UNRESOLVED_REFERENCE!>v<!>
|
||||
<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
<!UNRESOLVED_REFERENCE!>B<!>()
|
||||
|
||||
val inst = <!UNRESOLVED_REFERENCE!>A<!>()
|
||||
val ia = <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>a<!>
|
||||
val iv = <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>v<!>
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>a<!>()
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inst<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>B<!>()
|
||||
}
|
||||
|
||||
@@ -35,3 +35,8 @@ package p {
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
// -- Module: <m3> --
|
||||
package
|
||||
|
||||
public fun test3(): kotlin.Unit
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
// FIR_IDENTICAL
|
||||
// SKIP_KT_DUMP
|
||||
// IGNORE_BACKEND_K1: JS_IR
|
||||
// IGNORE_BACKEND_K1: JS_IR_ES6
|
||||
|
||||
// MODULE: a
|
||||
// FILE: a.kt
|
||||
package a
|
||||
|
||||
typealias A = String
|
||||
|
||||
// MODULE: b(a)
|
||||
// FILE: b.kt
|
||||
package b
|
||||
|
||||
import a.A
|
||||
|
||||
fun foo(f: () -> A): A = f()
|
||||
|
||||
// MODULE: c(b)
|
||||
// FILE: c.kt
|
||||
import b.foo
|
||||
|
||||
fun box(): String = foo { "OK" }
|
||||
@@ -1,35 +0,0 @@
|
||||
// MODULE: a
|
||||
// FILE: a.kt
|
||||
package a
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: a.A
|
||||
// Public signature: a/A|null[0]
|
||||
typealias A = String
|
||||
// MODULE: b
|
||||
// FILE: b.kt
|
||||
package b
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: b#foo(kotlin.Function0<kotlin.String>){}kotlin.String
|
||||
// Public signature: b/foo|-5020381652845254261[0]
|
||||
// Public signature debug description: foo(kotlin.Function0<kotlin.String>){}kotlin.String
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: b#foo(kotlin.Function0<kotlin.String>){}
|
||||
// Public signature: b/foo|-2695324588787180624[0]
|
||||
// Public signature debug description: foo(kotlin.Function0<kotlin.String>){}
|
||||
fun foo(f: Function0<String>): String
|
||||
|
||||
// MODULE: c
|
||||
// FILE: c.kt
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: #box(){}kotlin.String
|
||||
// Public signature: /box|-9347091776561469[0]
|
||||
// Public signature debug description: box(){}kotlin.String
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: #box(){}
|
||||
// Public signature: /box|2173511048851971368[0]
|
||||
// Public signature debug description: box(){}
|
||||
fun box(): String
|
||||
|
||||
Reference in New Issue
Block a user