When overriding a nullable function/property, with...
# getting-started
m
When overriding a nullable function/property, with a return-null implementation, is it generally good practice to change the signature to
Nothing?
Copy code
override val foo: Nothing? get() = null
e
I would generally say no. that prevents any further overrides from returning any non-null value. (and if that is your intent, then just make it final too)
👍 1