Fix create expected for classes with anonymous initializers
This commit is contained in:
@@ -191,6 +191,7 @@ private fun KtPsiFactory.generateClassOrObjectByActualClass(
|
||||
is KtEnumEntry -> return@forEach
|
||||
is KtClassOrObject -> it.delete()
|
||||
is KtCallableDeclaration -> it.delete()
|
||||
is KtAnonymousInitializer -> it.delete()
|
||||
}
|
||||
}
|
||||
expectedClass.primaryConstructor?.delete()
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
expect class My {
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Create expected class in common module testModule_Common" "true"
|
||||
// DISABLE-ERRORS
|
||||
|
||||
actual class <caret>My {
|
||||
init {}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Create expected class in common module testModule_Common" "true"
|
||||
// DISABLE-ERRORS
|
||||
|
||||
actual class My {
|
||||
init {}
|
||||
}
|
||||
+5
@@ -294,6 +294,11 @@ public class QuickFixMultiModuleTestGenerated extends AbstractQuickFixMultiModul
|
||||
runTest("idea/testData/multiModuleQuickFix/expectClassWithAliases/");
|
||||
}
|
||||
|
||||
@TestMetadata("expectClassWithInitializer")
|
||||
public void testExpectClassWithInitializer() throws Exception {
|
||||
runTest("idea/testData/multiModuleQuickFix/expectClassWithInitializer/");
|
||||
}
|
||||
|
||||
@TestMetadata("expectClassWithPlatformNested")
|
||||
public void testExpectClassWithPlatformNested() throws Exception {
|
||||
runTest("idea/testData/multiModuleQuickFix/expectClassWithPlatformNested/");
|
||||
|
||||
Reference in New Issue
Block a user