Make Null a subclass of AnyVal under -Yexplicit-nulls

i think maybe what you’re missing is that after this change Null is just another well-behaving value type and in pure scala there’s no reason to exclude it from generic code any more than you would exclude Int or Boolean

the only 2 cases where there might be a reason to is:

  1. null as sentinel - see sjrd’s superior alternative (ie. allow Null and use a private object as sentinel instead)
  2. interop - see the discussion about a way to exclude null generally, and in the meantime use a combination of using erased NotGiven[Null <:< T] (for Object-only types) and .nn (for broader types)

this is my assessment of the situation. someone pls correct me if i’m wrong

4 Likes