From b450b4a62a9550f3fa45858f44c02337dfeae692 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Tue, 14 Feb 2023 23:19:50 +0100 Subject: [PATCH 1/2] Derivation documentation: use `inline def derived` so that `derives` is employed --- docs/_docs/reference/contextual/derivation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/reference/contextual/derivation.md b/docs/_docs/reference/contextual/derivation.md index fb8acd0fad93..fc211bbb951c 100644 --- a/docs/_docs/reference/contextual/derivation.md +++ b/docs/_docs/reference/contextual/derivation.md @@ -419,7 +419,7 @@ object Eq: case ((x, y), elem) => check(elem)(x, y) } - inline given derived[T](using m: Mirror.Of[T]): Eq[T] = + inline def derived[T](using m: Mirror.Of[T]): Eq[T] = lazy val elemInstances = summonAll[m.MirroredElemTypes] inline m match case s: Mirror.SumOf[T] => eqSum(s, elemInstances) From de0c5a38e20c50c2b8685cca552ab71ffe473551 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Wed, 15 Feb 2023 12:07:06 +0100 Subject: [PATCH 2/2] Update derivation-macro.md --- docs/_docs/reference/contextual/derivation-macro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/reference/contextual/derivation-macro.md b/docs/_docs/reference/contextual/derivation-macro.md index be7565616913..533973e95464 100644 --- a/docs/_docs/reference/contextual/derivation-macro.md +++ b/docs/_docs/reference/contextual/derivation-macro.md @@ -31,7 +31,7 @@ given derived[T: Type](using Quotes): Expr[Eq[T]] and for comparison reasons we give the same signature we had with `inline`: ```scala -inline given derived[T](using Mirror.Of[T]): Eq[T] = ??? +inline def derived[T](using Mirror.Of[T]): Eq[T] = ??? ``` Note, that since a type is used in a subsequent stage it will need to be lifted