Offer to make INVISIBLE_MEMBER protected if referenced from subclass
So #KT-19614 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
0adf1d210f
commit
f0f6a252a5
+15
@@ -0,0 +1,15 @@
|
||||
// "Make 'doSth' protected" "false"
|
||||
// ACTION: Make 'doSth' public
|
||||
// ACTION: Make 'doSth' internal
|
||||
// ERROR: Cannot access 'doSth': it is private in 'A'
|
||||
|
||||
class A {
|
||||
private fun doSth() {
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
fun bar() {
|
||||
A().<caret>doSth()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Make 'doSth' protected" "true"
|
||||
|
||||
open class A {
|
||||
private fun doSth() {
|
||||
}
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
fun bar() {
|
||||
<caret>doSth()
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Make 'doSth' protected" "true"
|
||||
|
||||
open class A {
|
||||
protected fun doSth() {
|
||||
}
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
fun bar() {
|
||||
doSth()
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Make 'doSth' protected" "true"
|
||||
|
||||
open class A {
|
||||
private fun doSth() {
|
||||
}
|
||||
}
|
||||
|
||||
open class B : A()
|
||||
|
||||
class C : B() {
|
||||
fun bar() {
|
||||
<caret>doSth()
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Make 'doSth' protected" "true"
|
||||
|
||||
open class A {
|
||||
protected fun doSth() {
|
||||
}
|
||||
}
|
||||
|
||||
open class B : A()
|
||||
|
||||
class C : B() {
|
||||
fun bar() {
|
||||
doSth()
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Make 'foo' protected" "false"
|
||||
// ACTION: Make 'foo' public
|
||||
// ACTION: Make 'foo' internal
|
||||
// ACTION: Introduce local variable
|
||||
// ERROR: Cannot access 'foo': it is private in 'A'
|
||||
|
||||
class A {
|
||||
private val foo = 1
|
||||
}
|
||||
|
||||
class B {
|
||||
fun bar() {
|
||||
A().<caret>foo
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Make 'foo' protected" "true"
|
||||
|
||||
open class A {
|
||||
private val foo = 1
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
fun bar() {
|
||||
<caret>foo
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Make 'foo' protected" "true"
|
||||
|
||||
open class A {
|
||||
protected val foo = 1
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
fun bar() {
|
||||
foo
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Make 'foo' protected" "true"
|
||||
|
||||
open class A {
|
||||
private val foo = 1
|
||||
}
|
||||
|
||||
open class B : A()
|
||||
|
||||
class C : B() {
|
||||
fun bar() {
|
||||
<caret>foo
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Make 'foo' protected" "true"
|
||||
|
||||
open class A {
|
||||
protected val foo = 1
|
||||
}
|
||||
|
||||
open class B : A()
|
||||
|
||||
class C : B() {
|
||||
fun bar() {
|
||||
foo
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user