Skip to content

Commit

Permalink
Renamed fn to lambda everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jan 5, 2024
1 parent 1299491 commit f15543d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/adversaria.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ object Annotations:
: Annotations[AnnotationType, TargetType] =
${Adversaria.typeAnnotations[AnnotationType, TargetType]}

transparent inline def field[TargetType](inline fn: TargetType => Any): List[StaticAnnotation] =
${Adversaria.fieldAnnotations[TargetType]('fn)}
transparent inline def field[TargetType](inline lambda: TargetType => Any): List[StaticAnnotation] =
${Adversaria.fieldAnnotations[TargetType]('lambda)}

transparent inline def fields
[TargetType <: Product, AnnotationType <: StaticAnnotation]
Expand Down Expand Up @@ -109,14 +109,14 @@ object Adversaria:

def fieldAnnotations
[TargetType: Type]
(fn: Expr[TargetType => Any])
(lambda: Expr[TargetType => Any])
(using Quotes)
: Expr[List[StaticAnnotation]] =
import quotes.reflect.*

val targetType = TypeRepr.of[TargetType]

val field = fn.asTerm match
val field = lambda.asTerm match
case Inlined(_, _, Block(List(DefDef(_, _, _, Some(Select(_, term)))), _)) =>
targetType.typeSymbol.caseFields.find(_.name == term).getOrElse:
fail(msg"the member $term is not a case class field")
Expand Down

0 comments on commit f15543d

Please sign in to comment.