when calling extension function, correctly put receiver on top of stack if it was generated before the extension function object (KT-1918)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
class Bar {
|
||||
}
|
||||
|
||||
trait Foo {
|
||||
fun xyzzy(x: Any?): String
|
||||
}
|
||||
|
||||
fun buildFoo(bar: Bar.() -> Unit): Foo {
|
||||
return object : Foo {
|
||||
override fun xyzzy(x: Any?): String {
|
||||
(x as? Bar)?.bar()
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val foo = buildFoo({})
|
||||
return foo.xyzzy(Bar())
|
||||
}
|
||||
Reference in New Issue
Block a user