Skip to content

Commit 3301546

Browse files
committed
Fix a code example by adding a close parenthesis
1 parent 4034fe0 commit 3301546

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/docs/reference/contextual/derivation.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ enum Opt[+T] derives Eq:
279279
case Sm(t: T)
280280
case Nn
281281

282-
@main def test =
282+
@main def test(): Unit =
283283
import Opt.*
284284
val eqoi = summon[Eq[Opt[Int]]]
285285
assert(eqoi.eqv(Sm(23), Sm(23)))
@@ -312,6 +312,7 @@ As a third example, using a higher level library such as Shapeless the type clas
312312
given eqSum[A](using inst: => K0.CoproductInstances[Eq, A]): Eq[A] with
313313
def eqv(x: A, y: A): Boolean = inst.fold2(x, y)(false)(
314314
[t] => (eqt: Eq[t], t0: t, t1: t) => eqt.eqv(t0, t1)
315+
)
315316

316317
given eqProduct[A](using inst: K0.ProductInstances[Eq, A]): Eq[A] with
317318
def eqv(x: A, y: A): Boolean = inst.foldLeft2(x, y)(true: Boolean)(
@@ -344,7 +345,7 @@ hand side of this definition in the same way as an instance defined in ADT compa
344345

345346
### Syntax
346347

347-
```
348+
```ebnf
348349
Template ::= InheritClauses [TemplateBody]
349350
EnumDef ::= id ClassConstr InheritClauses EnumBody
350351
InheritClauses ::= [‘extends’ ConstrApps] [‘derives’ QualId {‘,’ QualId}]

0 commit comments

Comments
 (0)