Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/resolve/kt9601.kt
T
Juan Chen a1e0e8b0e7 [FIR] Handle receiver types of extension methods when computing maximally specific types.
Test case (from testPrimitiveReceiver):

fun Short.foo() = 3
fun Int.foo() = 4

1::foo
2020-04-15 11:16:33 +03:00

16 lines
239 B
Kotlin
Vendored

// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
open class A
class B: A()
fun A.foo() {}
fun B.foo() {} // more specific
fun bar(a: Any) {}
fun bar(a: Int) {} // more specific
fun test() {
B::foo
::bar
}