diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/refactoring/introduce/ExtractionTestGenerated.java b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/refactoring/introduce/ExtractionTestGenerated.java index 0c2c1baeeff5..87d0e13b7fdc 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/refactoring/introduce/ExtractionTestGenerated.java +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/refactoring/introduce/ExtractionTestGenerated.java @@ -2681,6 +2681,11 @@ public abstract class ExtractionTestGenerated extends AbstractExtractionTest { runTest("testData/refactoring/extractFunction/stringTemplates/multipleEntriesWithSuffix.kt"); } + @TestMetadata("propertyFromReceiver.kt") + public void testPropertyFromReceiver() throws Exception { + runTest("testData/refactoring/extractFunction/stringTemplates/propertyFromReceiver.kt"); + } + @TestMetadata("rawTemplateWithSubstring.kt") public void testRawTemplateWithSubstring() throws Exception { runTest("testData/refactoring/extractFunction/stringTemplates/rawTemplateWithSubstring.kt"); diff --git a/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/stringTemplates/propertyFromReceiver.kt b/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/stringTemplates/propertyFromReceiver.kt new file mode 100644 index 000000000000..7115bbb1d73b --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/stringTemplates/propertyFromReceiver.kt @@ -0,0 +1,9 @@ +import kotlin.reflect.KClass +internal fun KClass<*>.serializerNotRegistered(): Nothing { + throw IllegalStateException( + "Serializer for class '${simpleName}' is not found.\n" + + "Mark the class as @Serializable or provide the serializer explicitly." + ) +} + +// IGNORE_K1 \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/stringTemplates/propertyFromReceiver.kt.after b/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/stringTemplates/propertyFromReceiver.kt.after new file mode 100644 index 000000000000..6a48f453585c --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/stringTemplates/propertyFromReceiver.kt.after @@ -0,0 +1,11 @@ +import kotlin.reflect.KClass +internal fun KClass<*>.serializerNotRegistered(): Nothing { + throw IllegalStateException( + string() + ) +} + +private fun KClass<*>.string(): String = "Serializer for class '${simpleName}' is not found.\n" + + "Mark the class as @Serializable or provide the serializer explicitly." + +// IGNORE_K1 diff --git a/plugins/kotlin/refactorings/kotlin.refactorings.tests.k2/test/org/jetbrains/kotlin/idea/k2/refactoring/introduceFunction/K2IntroduceFunctionTestGenerated.java b/plugins/kotlin/refactorings/kotlin.refactorings.tests.k2/test/org/jetbrains/kotlin/idea/k2/refactoring/introduceFunction/K2IntroduceFunctionTestGenerated.java index bf90fe918d04..165d3e132478 100644 --- a/plugins/kotlin/refactorings/kotlin.refactorings.tests.k2/test/org/jetbrains/kotlin/idea/k2/refactoring/introduceFunction/K2IntroduceFunctionTestGenerated.java +++ b/plugins/kotlin/refactorings/kotlin.refactorings.tests.k2/test/org/jetbrains/kotlin/idea/k2/refactoring/introduceFunction/K2IntroduceFunctionTestGenerated.java @@ -1816,6 +1816,11 @@ public abstract class K2IntroduceFunctionTestGenerated extends AbstractK2Introdu runTest("../../idea/tests/testData/refactoring/extractFunction/stringTemplates/multipleEntriesWithSuffix.kt"); } + @TestMetadata("propertyFromReceiver.kt") + public void testPropertyFromReceiver() throws Exception { + runTest("../../idea/tests/testData/refactoring/extractFunction/stringTemplates/propertyFromReceiver.kt"); + } + @TestMetadata("rawTemplateWithSubstring.kt") public void testRawTemplateWithSubstring() throws Exception { runTest("../../idea/tests/testData/refactoring/extractFunction/stringTemplates/rawTemplateWithSubstring.kt");