KT-44079 [Sealed Interfaces]: move refactoring update
The idea behind this commit is that Move Refactoring should warn developers in case their intention potentially breaks sealed hierarchies (members must share the same module and package). Provided algorithm has two goals: - prevent destruction of correct hierarchies - help in fixing broken ones
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package other
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
sealed interface SealedInterfaceB
|
||||
sealed class HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
class NonSealedButMember: HierarchyClassA()
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
package sealed
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package sealed
|
||||
|
||||
sealed interface <caret>SealedInterfaceA
|
||||
sealed interface <caret>SealedInterfaceB
|
||||
|
||||
sealed class <caret>HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
class <caret>NonSealedButMember: HierarchyClassA()
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealed/SealedHierarchy.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "other",
|
||||
"targetSourceRoot": "A/src",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package other
|
||||
|
||||
import sealed.DerivedFromSealed
|
||||
|
||||
class NotSealedHierarchyMember: DerivedFromSealed()
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
sealed interface SealedInterfaceB
|
||||
|
||||
sealed class HierarchySealedClass: SealedInterfaceA, SealedInterfaceB
|
||||
class DerivedFromSealed: HierarchySealedClass()
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
sealed interface SealedInterfaceB
|
||||
|
||||
sealed class HierarchySealedClass: SealedInterfaceA, SealedInterfaceB
|
||||
class DerivedFromSealed: HierarchySealedClass()
|
||||
class <caret>NotSealedHierarchyMember: DerivedFromSealed()
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealed/SealedHierarchy.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "other",
|
||||
"targetSourceRoot": "A/src",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealedFirst
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package sealedSecond
|
||||
|
||||
import sealedFirst.SealedInterfaceA
|
||||
|
||||
sealed class HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealedSecond
|
||||
|
||||
sealed interface SealedInterfaceB
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package sealedFirst
|
||||
|
||||
import sealedSecond.SealedInterfaceB
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
sealed class <caret>HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealedSecond
|
||||
|
||||
sealed interface SealedInterfaceB
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
Sealed hierarchy of 'HierarchyClassA' would be split. Package 'sealedFirst' of module 'A' would still contain its members: [sealedFirst.SealedInterfaceA].
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealedFirst/SealedHierarchyPartA.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "sealedSecond",
|
||||
"targetSourceRoot": "A/src",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="B" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
sealed class HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceB
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="B" />
|
||||
</component>
|
||||
</module>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package sealed
|
||||
|
||||
sealed interface <caret>SealedInterfaceA
|
||||
sealed class HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceB
|
||||
+1
@@ -0,0 +1 @@
|
||||
Sealed hierarchy of 'SealedInterfaceA' would be split. Package 'sealed' of module 'A' would still contain its members: [sealed.HierarchyClassA].
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealed/SealedHierarchy.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "sealed",
|
||||
"targetSourceRoot": "B/src",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package other
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
package sealed
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
sealed interface <caret>SealedInterfaceA
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealed/SealedHierarchy.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "other",
|
||||
"targetSourceRoot": "A/src",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
package sealedFirst
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package sealedSecond
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
sealed class HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealedSecond
|
||||
|
||||
sealed interface SealedInterfaceB
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package sealedFirst
|
||||
|
||||
import sealedSecond.SealedInterfaceB
|
||||
|
||||
sealed interface <caret>SealedInterfaceA
|
||||
sealed class <caret>HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealedSecond
|
||||
|
||||
sealed interface SealedInterfaceB
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealedFirst/SealedHierarchyPartA.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "sealedSecond",
|
||||
"targetSourceRoot": "A/src",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="B" />
|
||||
</component>
|
||||
</module>
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
package sealed
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
sealed class HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceB
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="B" />
|
||||
</component>
|
||||
</module>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package sealed
|
||||
|
||||
sealed interface <caret>SealedInterfaceA
|
||||
sealed class <caret>HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceB
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealed/SealedHierarchy.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "sealed",
|
||||
"targetSourceRoot": "B/src",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package another
|
||||
|
||||
import sealed.SealedInterfaceA
|
||||
import sealed.SealedInterfaceB
|
||||
|
||||
class HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
sealed interface SealedInterfaceB
|
||||
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
sealed interface SealedInterfaceB
|
||||
|
||||
class <caret>HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
Sealed hierarchy of 'HierarchyClassA' would be split. None of its members reside in the package 'another' of module 'A': [sealed.HierarchyClassA, sealed.SealedInterfaceA, sealed.SealedInterfaceB].
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealed/SealedHierarchy.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "another",
|
||||
"targetSourceRoot": "A/src",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="B" />
|
||||
</component>
|
||||
</module>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceB
|
||||
|
||||
class HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
interface HelloGitEmptyDir
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="B" />
|
||||
</component>
|
||||
</module>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package sealed
|
||||
|
||||
sealed interface <caret>SealedInterfaceA
|
||||
sealed interface SealedInterfaceB
|
||||
|
||||
class HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
interface HelloGitEmptyDir
|
||||
+1
@@ -0,0 +1 @@
|
||||
Sealed hierarchy of 'SealedInterfaceA' would be split. None of its members reside in the package 'sealed' of module 'B': [sealed.SealedInterfaceA, sealed.HierarchyClassA, sealed.SealedInterfaceB].
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealed/SealedHierarchy.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "sealed",
|
||||
"targetSourceRoot": "B/src",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="B" />
|
||||
</component>
|
||||
</module>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceB
|
||||
sealed interface SealedInterfaceC
|
||||
sealed interface SealedInterfaceD: InterfaceI, SealedInterfaceA, SealedInterfaceB, SealedInterfaceC
|
||||
interface InterfaceE: SealedInterfaceD
|
||||
sealed interface SealedInterfaceF: InterfaceE
|
||||
sealed interface SealedInterfaceG
|
||||
interface InterfaceH: InterfaceE
|
||||
interface InterfaceI
|
||||
|
||||
class ClassA: InterfaceE
|
||||
class ClassC
|
||||
sealed class SealedClassB: SealedInterfaceB, SealedInterfaceC, ClassC()
|
||||
class ClassD: SealedClassB()
|
||||
sealed class SealedClassE: SealedClassB(), SealedInterfaceG
|
||||
class ClassF: ClassD()
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
interface HelloGitEmptyDir
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="B" />
|
||||
</component>
|
||||
</module>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package sealed
|
||||
|
||||
sealed interface <caret>SealedInterfaceA
|
||||
sealed interface SealedInterfaceB
|
||||
sealed interface SealedInterfaceC
|
||||
sealed interface SealedInterfaceD: InterfaceI, SealedInterfaceA, SealedInterfaceB, SealedInterfaceC
|
||||
interface InterfaceE: SealedInterfaceD
|
||||
sealed interface SealedInterfaceF: InterfaceE
|
||||
sealed interface SealedInterfaceG
|
||||
interface InterfaceH: InterfaceE
|
||||
interface InterfaceI
|
||||
|
||||
class ClassA: InterfaceE
|
||||
class ClassC
|
||||
sealed class SealedClassB: SealedInterfaceB, SealedInterfaceC, ClassC()
|
||||
class ClassD: SealedClassB()
|
||||
sealed class SealedClassE: SealedClassB(), SealedInterfaceG
|
||||
class ClassF: ClassD()
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
interface HelloGitEmptyDir
|
||||
+1
@@ -0,0 +1 @@
|
||||
Sealed hierarchy of 'SealedInterfaceA' would be split. None of its members reside in the package 'sealed' of module 'B': [sealed.SealedInterfaceA, sealed.SealedInterfaceD, sealed.SealedInterfaceB, sealed.SealedClassB, sealed.SealedInterfaceC, sealed.ClassD, sealed.SealedClassE, sealed.SealedInterfaceG, sealed.InterfaceE].
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealed/SealedHierarchy.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "sealed",
|
||||
"targetSourceRoot": "B/src",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package sealed
|
||||
|
||||
class HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
sealed interface SealedInterfaceB
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package sealed
|
||||
|
||||
sealed interface SealedInterfaceA
|
||||
sealed interface SealedInterfaceB
|
||||
|
||||
class <caret>HierarchyClassA: SealedInterfaceA, SealedInterfaceB
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"mainFile": "A/src/sealed/SealedHierarchy.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "sealed",
|
||||
"targetSourceRoot": "A/src/sealed",
|
||||
"withRuntime": "false"
|
||||
}
|
||||
Reference in New Issue
Block a user