[FIR] Fix setting file in supertypes resolution

^KT-49652 Fixed
This commit is contained in:
Dmitriy Novozhilov
2021-11-15 16:29:24 +03:00
committed by TeamCityServer
parent e11ffc75e4
commit 499b97d51e
7 changed files with 96 additions and 2 deletions
@@ -0,0 +1,26 @@
FILE: First.kt
package first
private final typealias Key = R|kotlin/String|
FILE: Third.kt
package first
public open class Base<T> : R|kotlin/Any| {
public constructor<T>(): R|first/Base<T>| {
super<R|kotlin/Any|>()
}
public final fun get(): R|T?| {
^get Null(null)
}
}
public final class Derived : R|first/Base<second/Second.Key>| {
public constructor(): R|first/Derived| {
super<R|first/Base<second/Second.Key>|>()
}
}
public final fun test(d: R|first/Derived|): R|kotlin/Unit| {
R|<local>/d|.R|SubstitutionOverride<first/Derived.get: R|second/Second.Key?|>|()?.{ $subj$.R|second/Second.Key.foo|() }
}
@@ -0,0 +1,33 @@
// ISSUE: KT-49652
// FILE: First.kt
package first
private typealias Key = String
// FILE: second/Second.java
package second
public class Second {
public static class Key {
public void foo() {}
}
public void bar() {}
}
// FILE: Third.kt
package first
import second.Second.*
import second.Second
open class Base<T> {
fun get(): T? = null
}
// Key is resolved to first.Key. In fact, should be second.Second.Key, because first.Key is private-in-file
class Derived : Base<Key>()
fun test(d: Derived) {
d.get()?.foo()
}