From 4164cecc2dce24f8092ba880911f0b39daf0791f Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 9 Nov 2023 11:27:47 +0200 Subject: [PATCH] [FIR2IR] Add TODO to fix smartcasted SAM conversions due to KT-62847, KT-63345 Note that `compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.kt` test should be updated after this change --- .../kotlin/fir/backend/generators/CallAndReferenceGenerator.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index 87cddb43adb..0c98c146044 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -1043,6 +1043,8 @@ class CallAndReferenceGenerator( irArgument = irArgument.insertSpecialCast(argument, argumentType, unsubstitutedParameterType) } } + // TODO: Applying SAM conversion should be extracted to a separate function, which will call + // convertArgument with original functional type as expected type, see KT-62847, KT-63345 with(adapterGenerator) { if (parameter?.returnTypeRef is FirResolvedTypeRef) { // Java type case (from annotations)