KT-51284 Fix SAM conversion for methods with context receivers
This commit is contained in:
committed by
Space Team
parent
cc9beb466e
commit
4676072137
+6
@@ -17456,6 +17456,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/iteratorOperator.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51284.kt")
|
||||
public void testKt51284() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt51284.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51863.kt")
|
||||
public void testKt51863() throws Exception {
|
||||
|
||||
@@ -387,12 +387,15 @@ private fun FirSimpleFunction.getFunctionTypeForAbstractMethod(): ConeLookupTagB
|
||||
val parameterTypes = valueParameters.map {
|
||||
it.returnTypeRef.coneTypeSafe<ConeKotlinType>() ?: ConeErrorType(ConeIntermediateDiagnostic("No type for parameter $it"))
|
||||
}
|
||||
|
||||
val contextReceiversTypes = contextReceivers.map {
|
||||
it.typeRef.coneTypeSafe<ConeKotlinType>() ?: ConeErrorType(ConeIntermediateDiagnostic("No type for context receiver $it"))
|
||||
}
|
||||
return createFunctionalType(
|
||||
parameterTypes,
|
||||
receiverType = receiverParameter?.typeRef?.coneType,
|
||||
rawReturnType = returnTypeRef.coneType,
|
||||
isSuspend = this.isSuspend
|
||||
isSuspend = this.isSuspend,
|
||||
contextReceivers = contextReceiversTypes
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user