Skip to content

Commit 8d932d0

Browse files
committed
Add regression test for i18670
1 parent faea285 commit 8d932d0

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/neg/i18670.check

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- [E172] Type Error: tests/neg/i18670.scala:11:38 ---------------------------------------------------------------------
2+
11 |case class Summary() extends Payload() // error
3+
| ^
4+
| No given instance of type TC[A] was found for a context parameter of constructor Payload in class Payload.
5+
| I found:
6+
|
7+
| TC.derived[A](/* missing */summon[scala.deriving.Mirror.Of[A]])
8+
|
9+
| But Failed to synthesize an instance of type scala.deriving.Mirror.Of[A]:
10+
| * class Nothing is not a generic product because it is not a case class
11+
| * class Nothing is not a generic sum because it is not a sealed class
12+
|
13+
| where: A is a type variable with constraint <: Payload[A]
14+
| .

tests/neg/i18670.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import scala.deriving.Mirror
2+
3+
type TC[A]
4+
5+
object TC:
6+
inline given derived[A](using Mirror.Of[A]): TC[A] = ???
7+
8+
abstract class Payload[A <: Payload[A]: TC]()
9+
10+
// infers Nothing and fail compilation
11+
case class Summary() extends Payload() // error

0 commit comments

Comments
 (0)