Skip to content

Commit

Permalink
feat: Make Length usable on Iterable of any type
Browse files Browse the repository at this point in the history
  • Loading branch information
Iltotore committed Sep 20, 2024
1 parent f6684ad commit a7e1d30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main/src/io/github/iltotore/iron/constraint/collection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ object collection:
val rflUtil = reflectUtil
import rflUtil.*

expr.decode match
case Right(value) => applyConstraint(Expr(value.size), constraintExpr)
expr.toExprList match
case Some(list) => applyConstraint(Expr(list.size), constraintExpr)
case _ => applyConstraint('{ $expr.size }, constraintExpr)

private def checkString[C, Impl <: Constraint[Int, C]](expr: Expr[String], constraintExpr: Expr[Impl])(using Quotes): Expr[Boolean] =
Expand Down

0 comments on commit a7e1d30

Please sign in to comment.