Skip to content

Commit

Permalink
avoid reflect API in error (#17420)
Browse files Browse the repository at this point in the history
small change I forgot to copy over
  • Loading branch information
bishabosha committed May 5, 2023
1 parent bd9e0f7 commit 5e7bfb2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docs/_docs/reference/contextual/derivation-macro.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,8 @@ object Eq:
case _ => '{ summonInline[Eq[Elem]] }

def deriveRec[T: Type, Elem: Type](using Quotes): Expr[Eq[Elem]] =
import quotes.reflect.*
Type.of[T] match
case '[Elem] => report.errorAndAbort("infinite recursive derivation")
case '[Elem] => '{ error("infinite recursive derivation") }
case _ => derivedMacro[Elem] // recursive derivation

inline def derived[T]: Eq[T] = ${ derivedMacro[T] }
Expand Down

0 comments on commit 5e7bfb2

Please sign in to comment.