Skip to content

Commit

Permalink
Infix notation for PositiveInt
Browse files Browse the repository at this point in the history
  • Loading branch information
dagmendez committed Oct 4, 2023
1 parent 70ed4fa commit f81dddc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ object refinedTypes:
* More info at [[https://docs.scala-lang.org/scala3/reference/metaprogramming/inline.html]]
*/
inline def apply(int: Int): PositiveInt =
inline if constValue[>[int.type, 0]]
inline if constValue[int.type >= 0]
then int
else error(codeOf(int) + " is negative. Int must be positive.")

Expand Down

0 comments on commit f81dddc

Please sign in to comment.