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 explicitShawn
10/19/2018, 3:25 PMobj ?: returnenleur
10/19/2018, 3:26 PMfun method(obj: Class?) {
requireNotNull(obj)
// ...
}gabrielfv
10/19/2018, 3:26 PMgabrielfv
10/19/2018, 3:27 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.Burkhard
10/19/2018, 3:28 PMval x = requireNotNullShawn
10/19/2018, 3:28 PMgabrielfv
10/19/2018, 3:28 PMgabrielfv
10/19/2018, 3:29 PMgabrielfv
10/19/2018, 3:30 PMfun method(obj: Class) {
requireNotNull(obj)
// ...
}Burkhard
10/19/2018, 3:31 PMgabrielfv
10/19/2018, 3:32 PMgabrielfv
10/19/2018, 3:33 PM@NonNull, but afaik it doesn't avoid anythingBurkhard
10/19/2018, 3:35 PMIntrinsics.checkParameterIsNotNull for all parameters. This will throw an InvalidArgumentExceptionneil.armstrong
10/19/2018, 3:35 PMfun method(obj: Class?) = obj?.let {
}gabrielfv
10/19/2018, 4:02 PM?: defaultValue to the end