KT-127 Support extension functions in when expressions

This commit is contained in:
Andrey Breslav
2011-10-27 21:29:44 +04:00
parent cff5ea58de
commit b467dc2de1
@@ -0,0 +1,15 @@
// KT-127 Support extension functions in when expressions
class Foo() {}
fun Any.equals(other : Any?) : Boolean = true
fun Any?.equals1(other : Any?) : Boolean = true
fun main(args: Array<String>) {
val command : Foo? = null
when (command) {
.equals(null) => 1; // must be resolved
?.equals(null) => 1 // same here
}
}