Extract Superclass: Report private members used in abstracted members

#KT-16284 Fixed
This commit is contained in:
Alexey Sedunov
2018-06-09 21:20:25 +03:00
parent bd88e02172
commit 9b7450cfdb
11 changed files with 93 additions and 35 deletions
@@ -0,0 +1,9 @@
// NAME: I
// SIBLING:
class <caret>PrivateRef {
// INFO: {checked: "true", toAbstract: "false"}
private fun privateFun() = 0
// INFO: {checked: "true", toAbstract: "true"}
fun refer() = privateFun()
}
@@ -0,0 +1 @@
Function 'fun refer(): Int' uses function 'fun privateFun(): Int' which won't be accessible from the subclass.
@@ -0,0 +1,11 @@
interface I {
// INFO: {checked: "true"}
fun privateFun() = 0
}
// NAME: I
// SIBLING:
class Foo : I {
fun refer() = privateFun()
}
@@ -1 +0,0 @@
Function 'fun privateFun(): Int' can't be moved to the interface because it's private and has usages in the original class