Fix elvis expression in case of nullable generic
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fun foo<T: Number?>(t: T) {
|
||||
(t ?: 42).toInt()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
foo<Int?>(null)
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun box(): String {
|
||||
if ((42 ?: 239) != 42) return "Fail Int"
|
||||
if ((42.toLong() ?: 239.toLong()) != 42.toLong()) return "Fail Long"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user