Open
Description
Compiler version
3.0.0-RC1
Compiler settings
flags: -Yexplicit-nulls + -language:strictEquality
Minimized code
def couldBeNull: String|Null = …
if couldBeNull == null then -1 else couldBeNull.length
Output
-- Error: <redacted>/app.scala:16:7
16 | if couldBeNull == null then -1 else couldBeNull.length
| ^^^^^^^^^^^^^^^^^^^
| Values of types Null | String and Null cannot be compared with == or !=
one error found
one error found
Expectation
no error found