K2: Set special function kind to function param with receiver

`StubBasedFirTypeDeserializer` handles function parameter with a
receiver with a special exception, which sets it as
`ExtensionFunctionType`, but skips setting special function kinds for it
even when the function parameter type is a special function kind. This
drops `Composable` annotation from a lambda expression if the function
parameter taking the lambda expression as an argument has a receiver,
which causes a severe CodeGen error for Compose app on K2 Android
Studio.

^KT-66526 Fixed
This commit is contained in:
Jaebaek Seo
2024-03-07 10:35:11 -08:00
committed by Space Cloud
parent cc6e0eb218
commit 90ccdb79ed
5 changed files with 70 additions and 1 deletions
@@ -231,7 +231,11 @@ internal class StubBasedFirTypeDeserializer(
constructor,
arguments,
isNullable = isNullable,
if (typeElement is KtFunctionType && typeElement.receiver != null) ConeAttributes.WithExtensionFunctionType else attributes
if (typeElement is KtFunctionType && typeElement.receiver != null) {
ConeAttributes.WithExtensionFunctionType.add(attributes)
} else {
attributes
}
)
}