diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.fir.txt index 20bde2607df..7436d9782b4 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.fir.txt @@ -2,7 +2,7 @@ FILE: lambdaForKfunction.kt public final fun foo(arg: R|kotlin/reflect/KFunction0|): R|kotlin/Unit| { } public final fun main(): R|kotlin/Unit| { - R|/foo|(fun (): R|kotlin/Unit| { + R|/foo#|(fun (): R|kotlin/Unit| { } ) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.kt index 02da3fa47af..23b5885ed48 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.kt @@ -5,5 +5,5 @@ import kotlin.reflect.KFunction0 fun foo(arg: KFunction0) {} fun main() { - foo(fun() {}) // K1: TYPE_MISMATCH, K2: ok in compile-time & CCE at run-time + foo(fun() {}) // K1: TYPE_MISMATCH, K2: ok in compile-time & CCE at run-time } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArguments.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArguments.kt index ad5b44f1fe5..c874b7f0e24 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArguments.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/PostponedArguments.kt @@ -64,7 +64,7 @@ fun Candidate.preprocessLambdaArgument( if (expectedType != null) { val parameters = resolvedArgument.parameters val functionTypeKind = context.session.functionTypeService.extractSingleSpecialKindForFunction(anonymousFunction.symbol) - ?: resolvedArgument.expectedFunctionTypeKind + ?: resolvedArgument.expectedFunctionTypeKind?.nonReflectKind() ?: FunctionTypeKind.Function val lambdaType = createFunctionType( functionTypeKind,