Skip to content

Missing warning for insensible comparison #6593

Open
@scabug

Description

@scabug

Something is up with these; I swear some of them used to warn. Really, I can't spot "Nil == 0" ?

scala> val x = scala.collection.mutable.Map[String, List[String]]() withDefaultValue Nil
x: scala.collection.mutable.Map[String,List[String]] = Map()

scala> x("bippy") == 0
res0: Boolean = false

scala> 0 == x("bippy")
<console>:9: warning: comparing values of types Int and List[String] using `==' will always yield false
              0 == x("bippy")
                ^
res1: Boolean = false

scala> (null: List[String]) == 0
res2: Boolean = false

scala> Nil == 0
res3: Boolean = false

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions