soronpo
1
With -Yexplicit-nulls
import language.strictEquality
val x: String | Null = null
val check = x == null //error
Should the explicit nulls feature introduce CanEqual[T | Null, Null]
and CanEqual[T | Null, T]
?
Could be relevant for the discussion, how to generally handle strict equality for unions:
This seems required for these two features to interact in a safe way
Is there a way to allow that, but disallow "null" == null
(Since "null"
is a String | null
) ?