Files
kotlin-fork/compiler/testData/codegen/box/callableReference/bound/companionObjectReceiver.kt
T
Kirill Rakhman 1f0e6321b0 [FIR2IR] Use companion as bound receiver if expected type requires it
A::foo is preferably resolved as an unbound reference to A.foo, however
if A.Companion is a subtype of A and the expected type has one fewer
parameter than the type of the unbound reference, generate a bound
reference with the companion as receiver.

^KT-56519 Fixed
2023-03-02 10:55:46 +00:00

9 lines
110 B
Kotlin
Vendored

class A {
companion object {
fun ok() = "OK"
}
}
fun box() = (A.Companion::ok).let { it() }