'when' should use intrinsics for '=='

#KT-19029 Fixed Target versions 1.1.5
 #KT-18818 Fixed Target versions 1.1.5
This commit is contained in:
Dmitry Petrov
2017-07-17 14:43:37 +03:00
parent 20cd748377
commit 2ed5a5e368
13 changed files with 281 additions and 51 deletions
+14
View File
@@ -0,0 +1,14 @@
// WITH_RUNTIME
fun findUserId(username: String): Long? = null
fun main(args: Array<String>) {
val userId = findUserId("abcd")
when (userId) {
null -> println("User not found")
else -> println("User ID: $userId")
}
}
// 0 areEqual