Disallow extension properties with backing fields
#KT-1682 Fixed
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
class A {
|
||||
var result = "Fail"
|
||||
|
||||
private var Int.foo: String
|
||||
get() = result
|
||||
private set(value) {
|
||||
result = value
|
||||
}
|
||||
|
||||
fun run(): String {
|
||||
class O {
|
||||
fun run() {
|
||||
42.foo = "OK"
|
||||
}
|
||||
}
|
||||
O().run()
|
||||
return (-42).foo
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = A().run()
|
||||
Reference in New Issue
Block a user