From f5c7db8270f811bb7679e691d802921de1d09104 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Thu, 10 Aug 2017 21:22:44 +0300 Subject: [PATCH] Change Signature: Support constructors of header/impl classes --- .../checkers/HeaderImplDeclarationChecker.kt | 5 ++- .../KotlinChangeSignatureData.kt | 19 ++++++---- .../KotlinChangeSignatureUsageProcessor.kt | 2 - .../after/Common/Common.iml | 19 ++++++++++ .../after/Common/src/test/test.kt | 7 ++++ .../headerPrimaryConstructor/after/JS/JS.iml | 20 ++++++++++ .../after/JS/src/test/test.kt | 10 +++++ .../after/JVM/JVM.iml | 20 ++++++++++ .../after/JVM/src/test/test.kt | 10 +++++ .../before/Common/Common.iml | 19 ++++++++++ .../before/Common/src/test/test.kt | 7 ++++ .../headerPrimaryConstructor/before/JS/JS.iml | 20 ++++++++++ .../before/JS/src/test/test.kt | 10 +++++ .../before/JVM/JVM.iml | 20 ++++++++++ .../before/JVM/src/test/test.kt | 10 +++++ .../after/Common/Common.iml | 19 ++++++++++ .../after/Common/src/test/test.kt | 7 ++++ .../after/JS/JS.iml | 20 ++++++++++ .../after/JS/src/test/test.kt | 7 ++++ .../after/JVM/JVM.iml | 20 ++++++++++ .../after/JVM/src/test/test.kt | 7 ++++ .../before/Common/Common.iml | 19 ++++++++++ .../before/Common/src/test/test.kt | 7 ++++ .../before/JS/JS.iml | 20 ++++++++++ .../before/JS/src/test/test.kt | 7 ++++ .../before/JVM/JVM.iml | 20 ++++++++++ .../before/JVM/src/test/test.kt | 7 ++++ .../after/Common/Common.iml | 19 ++++++++++ .../after/Common/src/test/test.kt | 10 +++++ .../after/JS/JS.iml | 20 ++++++++++ .../after/JS/src/test/test.kt | 10 +++++ .../after/JVM/JVM.iml | 20 ++++++++++ .../after/JVM/src/test/test.kt | 10 +++++ .../before/Common/Common.iml | 19 ++++++++++ .../before/Common/src/test/test.kt | 10 +++++ .../before/JS/JS.iml | 20 ++++++++++ .../before/JS/src/test/test.kt | 10 +++++ .../before/JVM/JVM.iml | 20 ++++++++++ .../before/JVM/src/test/test.kt | 10 +++++ .../after/Common/Common.iml | 19 ++++++++++ .../after/Common/src/test/test.kt | 7 ++++ .../implPrimaryConstructor/after/JS/JS.iml | 20 ++++++++++ .../after/JS/src/test/test.kt | 10 +++++ .../implPrimaryConstructor/after/JVM/JVM.iml | 20 ++++++++++ .../after/JVM/src/test/test.kt | 10 +++++ .../before/Common/Common.iml | 19 ++++++++++ .../before/Common/src/test/test.kt | 7 ++++ .../implPrimaryConstructor/before/JS/JS.iml | 20 ++++++++++ .../before/JS/src/test/test.kt | 10 +++++ .../implPrimaryConstructor/before/JVM/JVM.iml | 20 ++++++++++ .../before/JVM/src/test/test.kt | 10 +++++ .../after/Common/Common.iml | 19 ++++++++++ .../after/Common/src/test/test.kt | 7 ++++ .../after/JS/JS.iml | 20 ++++++++++ .../after/JS/src/test/test.kt | 7 ++++ .../after/JVM/JVM.iml | 20 ++++++++++ .../after/JVM/src/test/test.kt | 7 ++++ .../before/Common/Common.iml | 19 ++++++++++ .../before/Common/src/test/test.kt | 7 ++++ .../before/JS/JS.iml | 20 ++++++++++ .../before/JS/src/test/test.kt | 7 ++++ .../before/JVM/JVM.iml | 20 ++++++++++ .../before/JVM/src/test/test.kt | 7 ++++ .../after/Common/Common.iml | 19 ++++++++++ .../after/Common/src/test/test.kt | 10 +++++ .../implSecondaryConstructor/after/JS/JS.iml | 20 ++++++++++ .../after/JS/src/test/test.kt | 10 +++++ .../after/JVM/JVM.iml | 20 ++++++++++ .../after/JVM/src/test/test.kt | 10 +++++ .../before/Common/Common.iml | 19 ++++++++++ .../before/Common/src/test/test.kt | 10 +++++ .../implSecondaryConstructor/before/JS/JS.iml | 20 ++++++++++ .../before/JS/src/test/test.kt | 10 +++++ .../before/JVM/JVM.iml | 20 ++++++++++ .../before/JVM/src/test/test.kt | 10 +++++ .../KotlinChangeSignatureTest.kt | 2 +- .../KotlinMultiModuleChangeSignatureTest.kt | 38 +++++++++++++++++++ 77 files changed, 1075 insertions(+), 11 deletions(-) create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JVM/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/Common/Common.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/Common/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JS/JS.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JS/src/test/test.kt create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JVM/JVM.iml create mode 100644 idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JVM/src/test/test.kt diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/HeaderImplDeclarationChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/HeaderImplDeclarationChecker.kt index 2f32be87ce8..54e6101a6f8 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/HeaderImplDeclarationChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/HeaderImplDeclarationChecker.kt @@ -181,7 +181,10 @@ object HeaderImplDeclarationChecker : DeclarationChecker { listOf(module.getPackage(containingDeclaration.fqName).memberScope) } is ClassDescriptor -> { - containingDeclaration.findClassifiersFromModule(module).mapNotNull { (it as? ClassDescriptor)?.unsubstitutedMemberScope } + val classes = containingDeclaration.findClassifiersFromModule(module).filterIsInstance() + if (this is ConstructorDescriptor) return classes.flatMap { it.constructors } + + classes.map { it.unsubstitutedMemberScope } } else -> return emptyList() } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureData.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureData.kt index b7843adaaea..79fd30caca3 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureData.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureData.kt @@ -32,10 +32,7 @@ import org.jetbrains.kotlin.idea.highlighter.markers.headerImplementations import org.jetbrains.kotlin.idea.highlighter.markers.isHeaderOrHeaderClassMember import org.jetbrains.kotlin.idea.refactoring.changeSignature.usages.KotlinCallableDefinitionUsage import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers -import org.jetbrains.kotlin.psi.KtCallableDeclaration -import org.jetbrains.kotlin.psi.KtClass -import org.jetbrains.kotlin.psi.KtFunction -import org.jetbrains.kotlin.psi.KtNamedDeclaration +import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.resolve.DescriptorUtils import java.util.* @@ -99,14 +96,22 @@ class KotlinChangeSignatureData( override val affectedCallables: Collection by lazy { primaryCallables + primaryCallables.flatMapTo(HashSet()) { primaryFunction -> - val primaryDeclaration = primaryFunction.declaration as? KtCallableDeclaration ?: return@flatMapTo emptyList() + val primaryDeclaration = primaryFunction.declaration as? KtDeclaration ?: return@flatMapTo emptyList() if (primaryDeclaration.isHeaderOrHeaderClassMember()) { - return@flatMapTo primaryDeclaration.headerImplementations().map { - KotlinCallableDefinitionUsage(it, it.resolveToDescriptor() as CallableDescriptor, primaryFunction, null) + return@flatMapTo primaryDeclaration.headerImplementations().mapNotNull { + val descriptor = it.resolveToDescriptor() + val callableDescriptor = when (descriptor) { + is CallableDescriptor -> descriptor + is ClassDescriptor -> descriptor.unsubstitutedPrimaryConstructor ?: return@mapNotNull null + else -> return@mapNotNull null + } + KotlinCallableDefinitionUsage(it, callableDescriptor, primaryFunction, null) } } + if (primaryDeclaration !is KtCallableDeclaration) return@flatMapTo emptyList() + primaryDeclaration.toLightMethods().flatMap { baseMethod -> OverridingMethodsSearch .search(baseMethod) diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureUsageProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureUsageProcessor.kt index 9ff52f1c21e..1e864e6fad8 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureUsageProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureUsageProcessor.kt @@ -229,8 +229,6 @@ class KotlinChangeSignatureUsageProcessor : ChangeSignatureUsageProcessor { for (reference in findReferences(functionPsi)) { val element = reference.element - if (functionPsi is KtClass && reference.resolve() !== functionPsi) continue - if (element is KtReferenceExpression) { var parent = element.parent diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/Common/src/test/test.kt new file mode 100644 index 00000000000..4f2a39df037 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/Common/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +header class C(n: Int, b: Boolean) + +fun test() { + C(1, false) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JS/src/test/test.kt new file mode 100644 index 00000000000..952ce9e58c6 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JS/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(s: String) { + constructor(n: Int, b: Boolean): this("") +} + +fun test() { + C("1") + C(1, false) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JVM/src/test/test.kt new file mode 100644 index 00000000000..03eb3c0e08c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/after/JVM/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(n: Int, b: Boolean) { + constructor(s: String): this(1, false) +} + +fun test() { + C("1") + C(1, false) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/Common/src/test/test.kt new file mode 100644 index 00000000000..b78c877eda0 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/Common/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +header class C(n: Int) + +fun test() { + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JS/src/test/test.kt new file mode 100644 index 00000000000..c9ebaf0373d --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JS/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(s: String) { + constructor(n: Int): this("") +} + +fun test() { + C("1") + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JVM/src/test/test.kt new file mode 100644 index 00000000000..01af88fcece --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructor/before/JVM/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(n: Int) { + constructor(s: String): this(1) +} + +fun test() { + C("1") + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/Common/src/test/test.kt new file mode 100644 index 00000000000..7fb964dcb90 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/Common/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +header class C(n: Int) + +fun test() { + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JS/src/test/test.kt new file mode 100644 index 00000000000..df78424959e --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JS/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +impl class C(n: Int) + +fun test() { + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JVM/src/test/test.kt new file mode 100644 index 00000000000..df78424959e --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/after/JVM/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +impl class C(n: Int) + +fun test() { + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/Common/src/test/test.kt new file mode 100644 index 00000000000..bbacb371083 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/Common/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +header class C + +fun test() { + C() +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JS/src/test/test.kt new file mode 100644 index 00000000000..a5cd754bde5 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JS/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +impl class C() + +fun test() { + C() +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JVM/src/test/test.kt new file mode 100644 index 00000000000..0b1d8320f95 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerPrimaryConstructorNoParams/before/JVM/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +impl class C + +fun test() { + C() +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/Common/src/test/test.kt new file mode 100644 index 00000000000..3c1bba72e73 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/Common/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +header class C(s: String) { + constructor(n: Int, b: Boolean): this("") +} + +fun test() { + C(1, false) + C("1") +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JS/src/test/test.kt new file mode 100644 index 00000000000..952ce9e58c6 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JS/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(s: String) { + constructor(n: Int, b: Boolean): this("") +} + +fun test() { + C("1") + C(1, false) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JVM/src/test/test.kt new file mode 100644 index 00000000000..03eb3c0e08c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/after/JVM/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(n: Int, b: Boolean) { + constructor(s: String): this(1, false) +} + +fun test() { + C("1") + C(1, false) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/Common/src/test/test.kt new file mode 100644 index 00000000000..98d904bbc25 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/Common/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +header class C(s: String) { + constructor(n: Int): this("") +} + +fun test() { + C(1) + C("1") +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JS/src/test/test.kt new file mode 100644 index 00000000000..c9ebaf0373d --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JS/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(s: String) { + constructor(n: Int): this("") +} + +fun test() { + C("1") + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JVM/src/test/test.kt new file mode 100644 index 00000000000..01af88fcece --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/headerSecondaryConstructor/before/JVM/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(n: Int) { + constructor(s: String): this(1) +} + +fun test() { + C("1") + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/Common/src/test/test.kt new file mode 100644 index 00000000000..4f2a39df037 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/Common/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +header class C(n: Int, b: Boolean) + +fun test() { + C(1, false) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JS/src/test/test.kt new file mode 100644 index 00000000000..952ce9e58c6 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JS/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(s: String) { + constructor(n: Int, b: Boolean): this("") +} + +fun test() { + C("1") + C(1, false) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JVM/src/test/test.kt new file mode 100644 index 00000000000..03eb3c0e08c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/after/JVM/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(n: Int, b: Boolean) { + constructor(s: String): this(1, false) +} + +fun test() { + C("1") + C(1, false) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/Common/src/test/test.kt new file mode 100644 index 00000000000..7fb964dcb90 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/Common/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +header class C(n: Int) + +fun test() { + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JS/src/test/test.kt new file mode 100644 index 00000000000..c9ebaf0373d --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JS/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(s: String) { + constructor(n: Int): this("") +} + +fun test() { + C("1") + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JVM/src/test/test.kt new file mode 100644 index 00000000000..45c5833effa --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructor/before/JVM/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(n: Int) { + constructor(s: String): this(1) +} + +fun test() { + C("1") + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/Common/src/test/test.kt new file mode 100644 index 00000000000..7fb964dcb90 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/Common/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +header class C(n: Int) + +fun test() { + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JS/src/test/test.kt new file mode 100644 index 00000000000..df78424959e --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JS/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +impl class C(n: Int) + +fun test() { + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JVM/src/test/test.kt new file mode 100644 index 00000000000..df78424959e --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/after/JVM/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +impl class C(n: Int) + +fun test() { + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/Common/src/test/test.kt new file mode 100644 index 00000000000..05b81b767df --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/Common/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +header class C + +fun test() { + C() +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JS/src/test/test.kt new file mode 100644 index 00000000000..a5cd754bde5 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JS/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +impl class C() + +fun test() { + C() +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JVM/src/test/test.kt new file mode 100644 index 00000000000..bcfe730bdda --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implPrimaryConstructorNoParams/before/JVM/src/test/test.kt @@ -0,0 +1,7 @@ +package test + +impl class C + +fun test() { + C() +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/Common/src/test/test.kt new file mode 100644 index 00000000000..3c1bba72e73 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/Common/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +header class C(s: String) { + constructor(n: Int, b: Boolean): this("") +} + +fun test() { + C(1, false) + C("1") +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JS/src/test/test.kt new file mode 100644 index 00000000000..952ce9e58c6 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JS/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(s: String) { + constructor(n: Int, b: Boolean): this("") +} + +fun test() { + C("1") + C(1, false) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JVM/src/test/test.kt new file mode 100644 index 00000000000..03eb3c0e08c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/after/JVM/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(n: Int, b: Boolean) { + constructor(s: String): this(1, false) +} + +fun test() { + C("1") + C(1, false) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/Common/Common.iml b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/Common/Common.iml new file mode 100644 index 00000000000..0ecf9949f6c --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/Common/Common.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/Common/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/Common/src/test/test.kt new file mode 100644 index 00000000000..7b0df76f45f --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/Common/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +header class C(s: String) { + constructor(n: Int): this("") +} + +fun test() { + C(1) + C("1") +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JS/JS.iml b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JS/JS.iml new file mode 100644 index 00000000000..82d3e6bdf49 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JS/JS.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JS/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JS/src/test/test.kt new file mode 100644 index 00000000000..beee40f1272 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JS/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(s: String) { + constructor(n: Int): this("") +} + +fun test() { + C("1") + C(1) +} \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JVM/JVM.iml b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JVM/JVM.iml new file mode 100644 index 00000000000..c3173af9ec7 --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JVM/JVM.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JVM/src/test/test.kt b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JVM/src/test/test.kt new file mode 100644 index 00000000000..01af88fcece --- /dev/null +++ b/idea/testData/refactoring/changeSignatureMultiModule/implSecondaryConstructor/before/JVM/src/test/test.kt @@ -0,0 +1,10 @@ +package test + +impl class C(n: Int) { + constructor(s: String): this(1) +} + +fun test() { + C("1") + C(1) +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureTest.kt index d67603fb76e..625a33ad81e 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureTest.kt @@ -62,7 +62,7 @@ import java.util.* class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { companion object { - private val BUILT_INS = DefaultBuiltIns.Instance + internal val BUILT_INS = DefaultBuiltIns.Instance private val EXTENSIONS = arrayOf(".kt", ".java") } diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinMultiModuleChangeSignatureTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinMultiModuleChangeSignatureTest.kt index e7b87e58a90..f36cd2e19d8 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinMultiModuleChangeSignatureTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinMultiModuleChangeSignatureTest.kt @@ -23,7 +23,9 @@ import org.jetbrains.kotlin.idea.test.KotlinMultiFileTestCase import org.jetbrains.kotlin.idea.test.PluginTestCaseBase import org.jetbrains.kotlin.idea.test.extractMarkerOffset import org.jetbrains.kotlin.psi.KtElement +import org.jetbrains.kotlin.psi.KtPsiFactory import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode +import org.jetbrains.kotlin.types.KotlinType class KotlinMultiModuleChangeSignatureTest : KotlinMultiFileTestCase() { init { @@ -48,6 +50,18 @@ class KotlinMultiModuleChangeSignatureTest : KotlinMultiFileTestCase() { } } + private fun KotlinChangeInfo.addParameter(name: String, type: KotlinType, defaultValue: String) { + addParameter( + KotlinParameterInfo( + originalBaseFunctionDescriptor, + -1, + name, + KotlinTypeInfo(false, type), + defaultValueForCall = KtPsiFactory(project).createExpression(defaultValue) + ) + ) + } + fun testHeadersAndImplsByHeaderFun() = doTest("Common/src/test/test.kt") { newName = "baz" } @@ -63,4 +77,28 @@ class KotlinMultiModuleChangeSignatureTest : KotlinMultiFileTestCase() { fun testHeadersAndImplsByImplClassMemberFun() = doTest("JS/src/test/test.kt") { newName = "baz" } + + fun testHeaderPrimaryConstructorNoParams() = doTest("Common/src/test/test.kt") { + addParameter("n", KotlinChangeSignatureTest.BUILT_INS.intType, "1") + } + + fun testHeaderPrimaryConstructor() = doTest("Common/src/test/test.kt") { + addParameter("b", KotlinChangeSignatureTest.BUILT_INS.booleanType, "false") + } + + fun testHeaderSecondaryConstructor() = doTest("Common/src/test/test.kt") { + addParameter("b", KotlinChangeSignatureTest.BUILT_INS.booleanType, "false") + } + + fun testImplPrimaryConstructorNoParams() = doTest("JVM/src/test/test.kt") { + addParameter("n", KotlinChangeSignatureTest.BUILT_INS.intType, "1") + } + + fun testImplPrimaryConstructor() = doTest("JVM/src/test/test.kt") { + addParameter("b", KotlinChangeSignatureTest.BUILT_INS.booleanType, "false") + } + + fun testImplSecondaryConstructor() = doTest("JS/src/test/test.kt") { + addParameter("b", KotlinChangeSignatureTest.BUILT_INS.booleanType, "false") + } }