Skip to content

Commit d2b9bd8

Browse files
Merge pull request #14553 from dotty-staging/regression-test-#14544
Add regression test
2 parents 1b70511 + 3836bed commit d2b9bd8

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/neg/i14544.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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

tests/pos/i14544.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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)

0 commit comments

Comments
 (0)