Move: Warn about moving public declaration to non-public class

#KT-22771 Fixed
This commit is contained in:
Alexey Sedunov
2018-02-08 21:34:55 +03:00
parent acf6408474
commit 1af21dd160
9 changed files with 53 additions and 5 deletions
@@ -0,0 +1,7 @@
package test
private class PrivateClass {
class NestedClass {
val valInNestedC = 42
}
}
@@ -0,0 +1,8 @@
package test
class SomeClass {
}
fun main(args: Array<String>) {
val test = PrivateClass.NestedClass().valInNestedC
}
@@ -0,0 +1,3 @@
package test
private class PrivateClass
@@ -0,0 +1,11 @@
package test
class SomeClass {
class <caret>NestedClass {
val valInNestedC = 42
}
}
fun main(args: Array<String>) {
val test = SomeClass.NestedClass().valInNestedC
}
@@ -0,0 +1 @@
Variable test uses class NestedClass which will be inaccessible after move
@@ -0,0 +1,6 @@
{
"mainFile": "test/test.kt",
"type": "MOVE_KOTLIN_NESTED_CLASS",
"targetClass": "test.PrivateClass",
"withRuntime": "true"
}