Tests for Sealed Class move + Fix invalid move declaration test
MoveDeclarationToSeparateFile.testSealed test was threated to check that the intention is not applicable but it currently is.
This commit is contained in:
committed by
Igor Yakovlev
parent
91d603292c
commit
60e3787800
+5
@@ -0,0 +1,5 @@
|
||||
package bar
|
||||
|
||||
public sealed class SealedClass {
|
||||
public class Impl1 : SealedClass() {}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
import bar.SealedClass
|
||||
|
||||
val v = SealedClass::Impl1
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
import bar.SealedClass
|
||||
|
||||
public class Impl2 : SealedClass() {}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
val v = SealedClass::Impl1
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package foo
|
||||
|
||||
public sealed class <caret>SealedClass {
|
||||
public class Impl1 : SealedClass() {}
|
||||
}
|
||||
|
||||
public class Impl2 : SealedClass() {}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Sealed class 'SealedClass' must be moved with all its subclasses
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "foo/SealedClass.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "bar"
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package bar
|
||||
|
||||
public sealed class SealedClass {
|
||||
public class Impl1 : SealedClass() {}
|
||||
public class Impl2 : SealedClass() {}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
import bar.SealedClass
|
||||
|
||||
val v = SealedClass::Impl1
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
package foo
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
val v = SealedClass::Impl1
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package foo
|
||||
|
||||
public sealed class <caret>SealedClass {
|
||||
public class Impl1 : SealedClass() {}
|
||||
public class Impl2 : SealedClass() {}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "foo/SealedClass.kt",
|
||||
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||
"targetPackage": "bar"
|
||||
}
|
||||
Reference in New Issue
Block a user