Skip to content

strictEquality == works even if the given CanEqual fails #13725

@soronpo

Description

@soronpo

If an implicit to the CanEqual is introduced and fails, the == operation still compiles successfully.

Compiler version

v3.1.0-RC3

Minimized code

import scala.language.strictEquality
class Foo()
inline given CanEqual[Int, Foo] = compiletime.error("This should fail")

val x = 1 == Foo()

Output

No error

Expectation

We should get the error "This should fail"

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions