26c1098a4f
* Fix objects in inline functions and lambdas: * Add common lowerings used in K/JS and K/Native * Fix inline lambda call detection logic in presence of additional casts Merge-request: KT-MR-8791 Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
28 lines
388 B
Kotlin
Vendored
28 lines
388 B
Kotlin
Vendored
// KT-33992
|
|
|
|
class P<T>(val a: T, val b: T)
|
|
|
|
inline fun foo(x: () -> Any) = P(x(), x())
|
|
|
|
fun box(): String {
|
|
val p1 = foo {
|
|
class C
|
|
C()
|
|
}
|
|
val p2 = foo {
|
|
object {}
|
|
}
|
|
|
|
val x = p1.a
|
|
val y = p1.b
|
|
|
|
val a = p2.a
|
|
val b = p2.b
|
|
|
|
if (x::class != y::class) return "FAIL 1"
|
|
if (a::class != b::class) return "FAIL 2"
|
|
|
|
return "OK"
|
|
}
|
|
|