diff --git a/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/fromIntellij/InferredType.kt b/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/fromIntellij/InferredType.kt index 0ba48ff28769..9fa6ce0ae5a1 100644 --- a/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/fromIntellij/InferredType.kt +++ b/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/fromIntellij/InferredType.kt @@ -12,6 +12,4 @@ object Test { private fun gazonk() { val ss = bar(Test.foo()) } -} - -// IGNORE_K2 \ No newline at end of file +} \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/fromIntellij/InferredType.kt.after b/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/fromIntellij/InferredType.kt.after index 65ece0260038..23d2ea4d3440 100644 --- a/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/fromIntellij/InferredType.kt.after +++ b/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/fromIntellij/InferredType.kt.after @@ -7,6 +7,4 @@ object Test { private fun gazonk() { val ss = bar(emptyList()) } -} - -// IGNORE_K2 \ No newline at end of file +} \ No newline at end of file diff --git a/plugins/kotlin/refactorings/kotlin.refactorings.k2/src/org/jetbrains/kotlin/idea/k2/refactoring/inline/codeInliner/InlinePreprocessorUtil.kt b/plugins/kotlin/refactorings/kotlin.refactorings.k2/src/org/jetbrains/kotlin/idea/k2/refactoring/inline/codeInliner/InlinePreprocessorUtil.kt index cf32b5240240..7390fb37ba97 100644 --- a/plugins/kotlin/refactorings/kotlin.refactorings.k2/src/org/jetbrains/kotlin/idea/k2/refactoring/inline/codeInliner/InlinePreprocessorUtil.kt +++ b/plugins/kotlin/refactorings/kotlin.refactorings.k2/src/org/jetbrains/kotlin/idea/k2/refactoring/inline/codeInliner/InlinePreprocessorUtil.kt @@ -43,6 +43,7 @@ import org.jetbrains.kotlin.psi.KtPsiFactory import org.jetbrains.kotlin.psi.KtQualifiedExpression import org.jetbrains.kotlin.psi.KtReferenceExpression import org.jetbrains.kotlin.psi.KtSimpleNameExpression +import org.jetbrains.kotlin.psi.KtTypeParameter import org.jetbrains.kotlin.psi.KtUserType import org.jetbrains.kotlin.psi.KtValueArgumentName import org.jetbrains.kotlin.psi.createExpressionByPattern @@ -212,6 +213,8 @@ internal fun encodeInternalReferences(codeToInline: MutableCodeToInline, origina target.nameAsSafeName } expression.putCopyableUserData(CodeToInline.PARAMETER_USAGE_KEY, getParameterName()) + } else if (target is KtTypeParameter) { + expression.putCopyableUserData(CodeToInline.TYPE_PARAMETER_USAGE_KEY, target.nameAsName) } else if (resolve == (originalDeclaration as? KtNamedFunction)?.receiverTypeReference && isAnonymousFunctionWithReceiver && expression.getReceiverExpression() == null) { expression.putCopyableUserData(CodeToInline.PARAMETER_USAGE_KEY, Name.identifier("p1")) }