From 77db7b1b799d2b9fd8a8366db2d6b6fda19d5d5d Mon Sep 17 00:00:00 2001 From: Marat Dinmukhametov Date: Wed, 25 Sep 2024 20:52:01 +0300 Subject: [PATCH] [kotlin] IDEA-353900 k2: Don't produce <> if there is no params GitOrigin-RevId: afec1ef8347f39ada748a3f652a362be576dc2c7 --- .../kotlin/generate/KotlinUastBaseCodeGenerationPlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/kotlin/uast/uast-kotlin-base/src/org/jetbrains/uast/kotlin/generate/KotlinUastBaseCodeGenerationPlugin.kt b/plugins/kotlin/uast/uast-kotlin-base/src/org/jetbrains/uast/kotlin/generate/KotlinUastBaseCodeGenerationPlugin.kt index 91509e299694..523543669c59 100644 --- a/plugins/kotlin/uast/uast-kotlin-base/src/org/jetbrains/uast/kotlin/generate/KotlinUastBaseCodeGenerationPlugin.kt +++ b/plugins/kotlin/uast/uast-kotlin-base/src/org/jetbrains/uast/kotlin/generate/KotlinUastBaseCodeGenerationPlugin.kt @@ -249,11 +249,11 @@ abstract class KotlinUastElementFactory(project: Project) : UastElementFactory { val methodCallPsiType = KotlinUFunctionCallExpression(analyzableMethodCall, null).getExpressionType() if (methodCallPsiType == null || !expectedReturnType.isAssignableFrom(GenericsUtil.eliminateWildcards(methodCallPsiType))) { - val typeParams = (expectedReturnType as? PsiClassType)?.parameters?.map { it.getFQname(context) } + val typeParams = (expectedReturnType as? PsiClassType)?.parameters?.mapNotNull { it.getFQname(context) } if (typeParams == null) return KotlinUFunctionCallExpression(analyzableMethodCall, null) for (typeParam in typeParams) { - val typeParameter = psiFactory.createTypeArgument(typeParam.orEmpty()) + val typeParameter = psiFactory.createTypeArgument(typeParam) analyzableMethodCall.addTypeArgument(typeParameter) } return KotlinUFunctionCallExpression(analyzableMethodCall, null)