JET-69 Lookup equals() in a non-null type of the receiver.
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user