Fix property lookup in data class component generation

#KT-49812 Fixed
 #KT-49936 Fixed
This commit is contained in:
Alexander Udalov
2021-11-26 23:17:39 +01:00
parent 2fbd2e2a15
commit be6409f0af
17 changed files with 414 additions and 3 deletions
@@ -0,0 +1,11 @@
// WITH_STDLIB
data class Foo(val result: Result<Boolean>) {
val Boolean.result: String get() = if (this) "OK" else "Fail"
fun f(): String =
result.getOrNull()!!.result
}
fun box(): String =
Foo(Result.success(true)).f()
@@ -0,0 +1,5 @@
data class A(val x: String) {
val Int.x: Int get() = this
}
fun box(): String = A("OK").component1()