iseki
04/21/2020, 4:14 PM(T)->Unit
`<T: Any`> but allow null when T is nullable type... How to do that? Thank youShawn
04/21/2020, 4:15 PM<T : Any>
disallows T
from being a nullable typeShawn
04/21/2020, 4:16 PMT?
instead?fatih
04/21/2020, 4:16 PM<T : Any?>
Shawn
04/21/2020, 4:17 PMT
is allowed to be Any?
by default lolShawn
04/21/2020, 4:17 PMCasey Brooks
04/21/2020, 4:21 PM<T>
, it should be able to accept both nullable and non-null types. The type of (T)->Unit
should then be the same. https://pl.kotl.in/Zo8dB908pDico
04/21/2020, 9:04 PM: Any
type bound. This bound prevents T from being nullable, because null
is not assignable to Any
Dico
04/21/2020, 9:04 PMAny?
, which null
is assignable to.iseki
04/23/2020, 8:25 AMiseki
04/23/2020, 8:26 AM