JET-69 Lookup equals() in a non-null type of the receiver.

This commit is contained in:
Andrey Breslav
2011-05-30 20:12:31 +04:00
parent 6319ada926
commit c1dc1ebdac
@@ -0,0 +1,8 @@
fun parse(cmd: String): Command? { return null }
fun Any.equals(other : Any?) : Boolean = this === other
fun main(args: Array<String>) {
val command = parse("")
if (command == null) 1 // error on this line, but must be OK
}