Skip to content

Commit 9a7ec05

Browse files
authored
Merge pull request #9431 from ysthakur/patch-1
Use EmptyTuple instead of Unit in typeclass derivation docs
2 parents 89f42f4 + baa4897 commit 9a7ec05

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/docs/reference/contextual/derivation-macro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ have the given instances for our primitive types:
9595
case '[String *: $tpes] => '{ summon[Eq[String]] } :: summonAll(tpes)
9696
case '[Int *: $tpes] => '{ summon[Eq[Int]] } :: summonAll(tpes)
9797
case '[$tpe *: $tpes] => derived(using tpe, qctx) :: summonAll(tpes)
98-
case '[Unit] => Nil
98+
case '[EmptyTuple] => Nil
9999
}
100100
```
101101

@@ -173,7 +173,7 @@ object Eq {
173173
case '[String *: $tpes] => '{ summon[Eq[String]] } :: summonAll(tpes)
174174
case '[Int *: $tpes] => '{ summon[Eq[Int]] } :: summonAll(tpes)
175175
case '[$tpe *: $tpes] => derived(using tpe, qctx) :: summonAll(tpes)
176-
case '[Unit] => Nil
176+
case '[EmptyTuple] => Nil
177177
}
178178

179179
given derived[T: Type](using qctx: QuoteContext) as Expr[Eq[T]] = {
@@ -222,4 +222,4 @@ object Macro3 {
222222

223223
implicit inline def eqGen[T]: Eq[T] = ${ Eq.derived[T] }
224224
}
225-
```
225+
```

docs/docs/reference/contextual/derivation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ implementation of `summonAll` is `inline` and uses Dotty's `summonInline` constr
200200
```scala
201201

202202
inline def summonAll[T <: Tuple]: List[Eq[_]] = inline erasedValue[T] match {
203-
case _: Unit => Nil
203+
case _: EmptyTuple => Nil
204204
case _: (t *: ts) => summonInline[Eq[t]] :: summonAll[ts]
205205
}
206206
```
@@ -244,7 +244,7 @@ import scala.deriving._
244244
import scala.compiletime.{erasedValue, summonInline}
245245

246246
inline def summonAll[T <: Tuple]: List[Eq[_]] = inline erasedValue[T] match {
247-
case _: Unit => Nil
247+
case _: EmptyTuple => Nil
248248
case _: (t *: ts) => summonInline[Eq[t]] :: summonAll[ts]
249249
}
250250

0 commit comments

Comments
 (0)