Files
kotlin-fork/compiler/testData/codegen/box/defaultArguments/convention/kt9140.kt
T
Juan Chen 4c04ad2371 FIR: Add bindings for dispatch receiver parameters
Before this commit, such descriptors have null owners, which causes problems when the getter of the owner property is called.
2019-12-27 10:13:44 +03:00

11 lines
248 B
Kotlin
Vendored

class X {
operator fun get(name: String, type: String = "none") = name + type
}
fun box(): String {
if (X().get("a") != "anone") return "fail 1: ${X().get("a")}"
if (X()["a"] != "anone") return "fail 2: ${X()["a"]}"
return "OK"
}