KT-2991 Don't generate UNNECESSARY_NOT_NULL_ASSERTION on variables of
generic type T:Any? #KT-2991 Fixed
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
fun <T> test(t: T): T {
|
||||
if (t != null) {
|
||||
return t<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
}
|
||||
return t!!
|
||||
}
|
||||
|
||||
fun <T> T.testThis(): String {
|
||||
if (this != null) {
|
||||
return this<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.toString()
|
||||
}
|
||||
return this!!.toString()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user