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:
-7
@@ -1,7 +0,0 @@
|
||||
package source
|
||||
|
||||
import target.Expr
|
||||
|
||||
data class Const(val number: Double) : Expr()
|
||||
data class Sum(val e1: Expr, val e2: Expr) : Expr()
|
||||
object NotANumber : Expr()
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package target
|
||||
|
||||
sealed class Expr
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
package source
|
||||
|
||||
sealed class <caret>Expr
|
||||
data class Const(val number: Double) : Expr()
|
||||
data class Sum(val e1: Expr, val e2: Expr) : Expr()
|
||||
object NotANumber : Expr()
|
||||
-1
@@ -1 +0,0 @@
|
||||
Sealed class 'Expr' must be moved with all its subclasses
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"mainFile": "source/Foo.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "target"
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package source
|
||||
|
||||
sealed class Expr
|
||||
data class Sum(val e1: Expr, val e2: Expr) : Expr()
|
||||
object NotANumber : Expr()
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package target
|
||||
|
||||
import source.Expr
|
||||
|
||||
data class Const(val number: Double) : Expr()
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
package source
|
||||
|
||||
sealed class Expr
|
||||
data class <caret>Const(val number: Double) : Expr()
|
||||
data class Sum(val e1: Expr, val e2: Expr) : Expr()
|
||||
object NotANumber : Expr()
|
||||
-1
@@ -1 +0,0 @@
|
||||
Class 'Expr' must be moved with sealed parent class and all its subclasses
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"mainFile": "source/Foo.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "target"
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package bar
|
||||
|
||||
public sealed class SealedClass {
|
||||
public class Impl1 : SealedClass() {}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package foo
|
||||
|
||||
import bar.SealedClass
|
||||
|
||||
val v = SealedClass::Impl1
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package foo
|
||||
|
||||
import bar.SealedClass
|
||||
|
||||
public class Impl2 : SealedClass() {}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package foo
|
||||
|
||||
val v = SealedClass::Impl1
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package foo
|
||||
|
||||
public sealed class <caret>SealedClass {
|
||||
public class Impl1 : SealedClass() {}
|
||||
}
|
||||
|
||||
public class Impl2 : SealedClass() {}
|
||||
-1
@@ -1 +0,0 @@
|
||||
Sealed class 'SealedClass' must be moved with all its subclasses
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"mainFile": "foo/SealedClass.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "bar"
|
||||
}
|
||||
+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
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user