From eb0f4167b34afb86fd928fa0d580c11fe6de3e47 Mon Sep 17 00:00:00 2001 From: Kirill Rakhman Date: Fri, 15 Dec 2023 10:33:22 +0100 Subject: [PATCH] [FIR2IR] Remove obsolete TODO #KT-62865 --- .../kotlin/fir/backend/generators/AdapterGenerator.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/AdapterGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/AdapterGenerator.kt index 613483bb793..84ca52203af 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/AdapterGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/AdapterGenerator.kt @@ -443,8 +443,7 @@ internal class AdapterGenerator( argumentConeType: ConeKotlinType, samType: ConeKotlinType, ): IrExpression { - // The rule for SAM conversions is: - // the argument must be a non-reflection function type and be a subtype of the required function type. + // The rule for SAM conversions is: the argument must be a subtype of the required function type. // We handle intersection types, captured types, etc. by approximating both expected and actual types. val approximatedConeKotlinFunctionType = getFunctionTypeForPossibleSamType(samType)?.approximateForIrOrSelf() ?: return argument @@ -453,10 +452,7 @@ internal class AdapterGenerator( // tests from FirBlackBoxCodegenTestGenerated relevant to INDY start failing once this line is removed. val approximateArgumentConeType = argumentConeType.approximateForIrOrSelf() - if (approximateArgumentConeType.isSubtypeOf(approximatedConeKotlinFunctionType, session) - // TODO uncomment when KT-63510 is fixed, probably fixes KT-62865 - // && approximateArgumentConeType.lowerBoundIfFlexible().functionTypeKind(session)?.isReflectType == false - ) { + if (approximateArgumentConeType.isSubtypeOf(approximatedConeKotlinFunctionType, session)) { return argument }