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 d23d963f8b60..ab9d93b3e1ea 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
@@ -868,6 +868,11 @@ public abstract class ExtractionTestGenerated extends AbstractExtractionTest {
KotlinTestUtils.runTest(this::doExtractFunctionTest, this, testDataFilePath);
}
+ @TestMetadata("approximatedReturnType.kt")
+ public void testApproximatedReturnType() throws Exception {
+ runTest("testData/refactoring/extractFunction/basic/approximatedReturnType.kt");
+ }
+
@TestMetadata("callWithLambdaArgument.kt")
public void testCallWithLambdaArgument() throws Exception {
runTest("testData/refactoring/extractFunction/basic/callWithLambdaArgument.kt");
diff --git a/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/basic/approximatedReturnType.kt b/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/basic/approximatedReturnType.kt
new file mode 100644
index 000000000000..6e342eede0ef
--- /dev/null
+++ b/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/basic/approximatedReturnType.kt
@@ -0,0 +1,8 @@
+class SimpleClass
+
+fun findClasses() {
+ val classloader = Alias::class.java.classLoader
+ val obj = classloader?.loadClass("")?.kotlin
+}
+
+// IGNORE_K1
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/basic/approximatedReturnType.kt.after b/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/basic/approximatedReturnType.kt.after
new file mode 100644
index 000000000000..49f273995d33
--- /dev/null
+++ b/plugins/kotlin/idea/tests/testData/refactoring/extractFunction/basic/approximatedReturnType.kt.after
@@ -0,0 +1,12 @@
+import kotlin.reflect.KClass
+
+class SimpleClass
+
+fun findClasses() {
+ val classloader = Alias::class.java.classLoader
+ val obj = klass(classloader)
+}
+
+private fun klass(classloader: ClassLoader?): KClass? = classloader?.loadClass("")?.kotlin
+
+// IGNORE_K1
\ No newline at end of file
diff --git a/plugins/kotlin/refactorings/kotlin.refactorings.tests.k2/test/org/jetbrains/kotlin/idea/k2/refactoring/introduce/K2IntroduceFunctionTestGenerated.java b/plugins/kotlin/refactorings/kotlin.refactorings.tests.k2/test/org/jetbrains/kotlin/idea/k2/refactoring/introduce/K2IntroduceFunctionTestGenerated.java
index fee7b8ece058..9c0140a12243 100644
--- a/plugins/kotlin/refactorings/kotlin.refactorings.tests.k2/test/org/jetbrains/kotlin/idea/k2/refactoring/introduce/K2IntroduceFunctionTestGenerated.java
+++ b/plugins/kotlin/refactorings/kotlin.refactorings.tests.k2/test/org/jetbrains/kotlin/idea/k2/refactoring/introduce/K2IntroduceFunctionTestGenerated.java
@@ -26,6 +26,11 @@ public abstract class K2IntroduceFunctionTestGenerated extends AbstractK2Introdu
KotlinTestUtils.runTest(this::doExtractFunctionTest, this, testDataFilePath);
}
+ @TestMetadata("approximatedReturnType.kt")
+ public void testApproximatedReturnType() throws Exception {
+ runTest("../../idea/tests/testData/refactoring/extractFunction/basic/approximatedReturnType.kt");
+ }
+
@TestMetadata("callWithLambdaArgument.kt")
public void testCallWithLambdaArgument() throws Exception {
runTest("../../idea/tests/testData/refactoring/extractFunction/basic/callWithLambdaArgument.kt");