there is a follow up proposal that basically should make those methods on Any that throw NullPointerException instead handle null gracefully when the reciever’s upper bound includes Null (for code compiled with latest compiler) - so therefore no fear of NPE when calling e.g. x.toString or x.getClass (specifically with additional wrapper code only in situations where x: T and Null <:< T)
1 Like