Fix test data OverridenSetterVisibility.kt
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
public interface ITest {
|
||||||
|
public var prop : Int
|
||||||
|
get() = 12
|
||||||
|
set(value) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class ATest {
|
||||||
|
protected open var prop2 : Int
|
||||||
|
get() = 13
|
||||||
|
set(value) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Test: ATest(), ITest {
|
||||||
|
override var prop : Int
|
||||||
|
get() = 12
|
||||||
|
<!CANNOT_WEAKEN_ACCESS_PRIVILEGE!>private<!> set(value) {}
|
||||||
|
|
||||||
|
override var prop2 : Int
|
||||||
|
get() = 14
|
||||||
|
<!CANNOT_CHANGE_ACCESS_PRIVILEGE, SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY!>internal<!> set(value) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
val test = Test()
|
||||||
|
test.prop = 12
|
||||||
|
|
||||||
|
val itest: ITest = test
|
||||||
|
itest.prop = 12 // No error here
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_IDENTICAL
|
|
||||||
public interface ITest {
|
public interface ITest {
|
||||||
public var prop : Int
|
public var prop : Int
|
||||||
get() = 12
|
get() = 12
|
||||||
@@ -23,7 +22,7 @@ class Test: ATest(), ITest {
|
|||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
val test = Test()
|
val test = Test()
|
||||||
test.prop = 12
|
<!INVISIBLE_SETTER!>test.prop<!> = 12
|
||||||
|
|
||||||
val itest: ITest = test
|
val itest: ITest = test
|
||||||
itest.prop = 12 // No error here
|
itest.prop = 12 // No error here
|
||||||
|
|||||||
Reference in New Issue
Block a user