Fix synthetic accessor generation for properties

Generate synthetic accessors for property accessors only if the
corresponding methods are accessible in the current context.

 #KT-19306 Fixed Target versions 1.1.5
This commit is contained in:
Dmitry Petrov
2017-08-01 09:02:33 +03:00
parent dde0efd8ab
commit 2427b2cc6c
3 changed files with 55 additions and 6 deletions
@@ -0,0 +1,24 @@
// FILE: A.kt
package a
abstract class A {
protected var property: String = ""
private set
}
// FILE: B.kt
package b
import a.A
class B : A() {
init {
invoke { property }
}
fun invoke(func: () -> String): String = func()
}
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: b/B, access$setProperty$p
// ABSENT: true