Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/neg/i18670.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- [E172] Type Error: tests/neg/i18670.scala:11:38 ---------------------------------------------------------------------
11 |case class Summary() extends Payload() // error
| ^
| No given instance of type TC[A] was found for a context parameter of constructor Payload in class Payload.
| I found:
|
| TC.derived[A](/* missing */summon[scala.deriving.Mirror.Of[A]])
|
| But Failed to synthesize an instance of type scala.deriving.Mirror.Of[A]:
| * class Nothing is not a generic product because it is not a case class
| * class Nothing is not a generic sum because it is not a sealed class
|
| where: A is a type variable with constraint <: Payload[A]
| .
11 changes: 11 additions & 0 deletions tests/neg/i18670.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import scala.deriving.Mirror

type TC[A]

object TC:
inline given derived[A](using Mirror.Of[A]): TC[A] = ???

abstract class Payload[A <: Payload[A]: TC]()

// infers Nothing and fail compilation
case class Summary() extends Payload() // error