Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
pablf committed Jun 30, 2024
1 parent 5cf8a4f commit 57f28a2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ private case class DeriveSchema()(using val ctx: Quotes) {
val cases = typesAndLabels.map { case (tpe, label) => deriveCase[T](tpe, label, newStack) }

val numParentFields: Int = TypeRepr.of[T].typeSymbol.declaredFields.length
val isSimpleEnum: Boolean = !TypeRepr.of[T].typeSymbol.children.map(_.declaredFields.length).exists( _ != 0 )
val childrenFields = TypeRepr.of[T].typeSymbol.children.map(_.declaredFields.length)
val isSimpleEnum: Boolean = childrenFields.forall( _ == 0 ) || childrenFields.forall( _ <= numParentFields )
val hasSimpleEnumAnn: Boolean = TypeRepr.of[T].typeSymbol.hasAnnotation(TypeRepr.of[_root_.zio.schema.annotation.simpleEnum].typeSymbol)

val docAnnotationExpr = TypeRepr.of[T].typeSymbol.docstring.map { docstring =>
Expand Down

0 comments on commit 57f28a2

Please sign in to comment.