Skip to content

Provide CanEqual for Option (Option == None), Throwables, and other #15521

Closed
@strelec

Description

@strelec

Minimized code

x match {
  case Some(value) =>
  case None =>
}

Output

[error] 129 |					case None =>
[error]     |					     ^^^^
[error]     |					     Values of types object None and Option[T] cannot be compared with == or !=.
[error]     |					     I found:
[error]     |
[error]     |					         CanEqual.canEqualOptions[T, U](/* missing */summon[CanEqual[T, U]])
[error]     |
[error]     |					     But no implicit values were found that match type CanEqual[T, U].

Expectation

CanEqual instance should come already defined for at the very least, the standard library. You have to strike a balance between versatility and usability.

As it is currently, -language:strictEquality is too cautious to be useful.

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