[LL API] Fix analysis of functions inside code fragments

FirDeclarationsResolveTransformer.transformSimpleFunction() performs
proper local function analysis only if the parent is properly set.

^KTIJ-26608 Fixed
This commit is contained in:
Yan Zhulanow
2023-09-07 18:54:35 +09:00
committed by Space Team
parent 909f32ed54
commit 9514f8f873
10 changed files with 51 additions and 8 deletions
@@ -1,7 +1,7 @@
fun foo() {}
fun foo(a: Int, b: String) {}
fun bar() {
<expr>foo()</expr>
<expr>foo(1, "foo")</expr>
}
bar()
@@ -1,10 +1,10 @@
BEFORE MODIFICATION:
CODE FRAGMENT: {
local final? [ResolvedTo(RAW_FIR)] fun foo(): R|kotlin/Unit| {
local final [ResolvedTo(RAW_FIR)] fun foo([ResolvedTo(RAW_FIR)] a: R|kotlin/Int|, [ResolvedTo(RAW_FIR)] b: R|kotlin/String|): R|kotlin/Unit| {
}
local final? [ResolvedTo(RAW_FIR)] fun bar(): R|kotlin/Unit| {
R|/foo|()
local final [ResolvedTo(RAW_FIR)] fun bar(): R|kotlin/Unit| {
R|/foo|(Int(1), String(foo))
}
R|/bar|()