Protected in final inspection: protected modifier is effectively private in final classes #KT-6674 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
20bac6178c
commit
a541aaafd8
@@ -0,0 +1,37 @@
|
||||
class F {
|
||||
protected val foo: Int = 0
|
||||
|
||||
protected fun bar() {}
|
||||
|
||||
protected class Nested
|
||||
}
|
||||
|
||||
class G {
|
||||
interface H {
|
||||
protected val foo: Int = 0
|
||||
|
||||
protected fun bar() {}
|
||||
|
||||
protected class Nested
|
||||
}
|
||||
}
|
||||
|
||||
sealed class S {
|
||||
protected val foo: Int = 0
|
||||
|
||||
protected fun bar() {}
|
||||
|
||||
protected class Nested : S()
|
||||
|
||||
protected object Obj : S()
|
||||
}
|
||||
|
||||
enum class E {
|
||||
SINGLE {
|
||||
override val x = foo()
|
||||
};
|
||||
|
||||
abstract val x: Int
|
||||
|
||||
protected fun foo() = 42
|
||||
}
|
||||
Reference in New Issue
Block a user