Look into proper context when generating backing field access

Problem manifests when a class property name matches a companion object
property name, and class property is referenced in closure context.

 #KT-19367 Fixed Target versions 1.1.5
This commit is contained in:
Dmitry Petrov
2017-08-01 10:35:57 +03:00
parent 05eee9c173
commit c5613888eb
6 changed files with 47 additions and 1 deletions
@@ -0,0 +1,15 @@
// WITH_RUNTIME
class Host {
val ok = "OK"
fun foo() = run { bar(ok) }
companion object {
val ok = 0
fun bar(s: String) = s.substring(ok)
}
}
fun box() = Host().foo()