mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 08:31:31 +00:00
25 lines
519 B
Kotlin
Vendored
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
|
|
} |