[FIR] Get FirSession from declaration in ReturnTypeCalculatorWithJump

If the session is from the other module, it might not know about
FirFiles which are relevant for transforming and resolving the
declaration

^KT-52136 Fixed
This commit is contained in:
Roman Golyshev
2022-04-21 17:05:23 +04:00
committed by Space
parent ed6ddf4e4f
commit 1d5cb8ab75
11 changed files with 85 additions and 10 deletions
@@ -0,0 +1,30 @@
Module: lib
FILE: module_lib_implicitTypeFromOtherModule.kt
package dependency
public final class Other : R|kotlin/Any| {
public constructor(): R|dependency/Other| {
super<R|kotlin/Any|>()
}
}
public final class Lib : R|kotlin/Any| {
public constructor(): R|dependency/Lib| {
super<R|kotlin/Any|>()
}
}
public final fun test(): R|dependency/Lib| {
^test R|dependency/Lib.Lib|()
}
Module: main
FILE: module_main_implicitTypeFromOtherModule.kt
package main
public final fun usage(): R|kotlin/Unit| {
R|main/take|(R|dependency/test|())
}
public final fun take(a: R|dependency/Lib|): R|kotlin/Unit| {
}
public final fun take(a: R|dependency/Other|): R|kotlin/Unit| {
}
@@ -0,0 +1,27 @@
// SKIP_JAVAC
// This directive is needed to skip this test in LazyBodyIsNotTouchedTilContractsPhaseTestGenerated,
// because it fails to parse module structure of multimodule test
// MODULE: lib
package dependency
class Other
class Lib
fun test() = Lib()
// MODULE: main(lib)
package main
import dependency.test
import dependency.Lib
import dependency.Other
fun usage() {
take(test())
}
fun take(a: Lib) {}
fun take(a: Other) {}