File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ import scala .language .strictEquality
2+
3+ case class MyClass [A ](value : String )(val a : A ) derives CanEqual
4+
5+ class Something {}
6+
7+ val a = MyClass [Something ](" some" )(new Something ())
8+ val b = MyClass [Something ](" some" )(new Something ())
9+ val c = new Something ()
10+ val d = new Something ()
11+
12+ def test1 = println(a == b) // error
13+ def test2 = println(c == d) // error
Original file line number Diff line number Diff line change 1+ import scala .language .strictEquality
2+
3+ case class MyClass [A ](value : String )(val a : A ) derives CanEqual
4+
5+ class Something {}
6+ given CanEqual [Something , Something ] = CanEqual .derived
7+
8+ val a = MyClass [Something ](" some" )(new Something ())
9+ val b = MyClass [Something ](" some" )(new Something ())
10+ val c = new Something ()
11+ val d = new Something ()
12+
13+ def test1 = println(a == b)
14+ def test2 = println(c == d)
You can’t perform that action at this time.
0 commit comments