Skip to content

strictEquality doesn't work with union types #21839

Open
@OlegYch

Description

@OlegYch

Compiler version

3.5.1

Minimized code

val a = List(Some(true), Some(()), None)
a.exists(_ == None)

Output

Values of types Option[Boolean | Unit] and object None cannot be compared with == or !=.

Expectation

the code compiles

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions