juangamnik
08/07/2016, 12:52 PMT
can be substituted with an optional type. I thought you have to use T?
then. I don't know whether it is a good idea to replace T
with some T'?
with T': T
because then the code expects instances of T
not to be null
, so that t.foo()
would be Ok for the compiler (declaration-site) although it may be an NPE... I will test this with Kotlin 1.0.3 🤓. But if it is ok for the compiler, a corresponding implicit Boolean flag parameter could be used...