gabrielfv
10/19/2018, 3:22 PMShawn
10/19/2018, 3:23 PMBurkhard
10/19/2018, 3:24 PMgabrielfv
10/19/2018, 3:24 PMShawn
10/19/2018, 3:25 PMnull
, then I’d say you ought to make it explicitobj ?: return
enleur
10/19/2018, 3:26 PMfun method(obj: Class?) {
requireNotNull(obj)
// ...
}
gabrielfv
10/19/2018, 3:26 PMShawn
10/19/2018, 3:27 PMrequireNotNull()
doesn’t yet work with smart-castingBurkhard
10/19/2018, 3:27 PMnull
but the function actually fails.val x = requireNotNull
Shawn
10/19/2018, 3:28 PMgabrielfv
10/19/2018, 3:28 PMfun method(obj: Class) {
requireNotNull(obj)
// ...
}
Burkhard
10/19/2018, 3:31 PMgabrielfv
10/19/2018, 3:32 PM@NonNull
, but afaik it doesn't avoid anythingBurkhard
10/19/2018, 3:35 PMIntrinsics.checkParameterIsNotNull
for all parameters. This will throw an InvalidArgumentException
neil.armstrong
10/19/2018, 3:35 PMfun method(obj: Class?) = obj?.let {
}
gabrielfv
10/19/2018, 4:02 PM?: defaultValue
to the end