Files
kotlin/compiler/testData/codegen/box/callableReference/bound/boundReferenceToOverloadedFunction.kt
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

25 lines
519 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
interface JsonParser
interface JsonCodingParser : JsonParser
var result = "fail"
fun JsonCodingParser.parseValue(source: String): Any = source
fun JsonParser.parseValue(source: String): Any = TODO()
fun testDecoding(decode: (String) -> Any) {
result = decode("OK") as String
}
class Test {
fun fooTest() {
val foo: JsonCodingParser = object : JsonCodingParser {}
testDecoding(foo::parseValue)
}
}
fun box(): String {
Test().fooTest()
return result
}