KT-2729 Warn on 'T?' where 'T' has a nullable upper bound
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// KT-312 Nullability problem when a nullable version of a generic type is returned
|
||||
|
||||
fun <T> Array<out T>.safeGet(index : Int) : T? {
|
||||
fun <T> Array<out T>.safeGet(index : Int) : T<!BASE_WITH_NULLABLE_UPPER_BOUND!>?<!> {
|
||||
return if (index < size) this[index] else null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user