All Downloads are FREE. Search and download functionalities are using the official Maven repository.

refined4s.InlinedRefined.scala Maven / Gradle / Ivy

package refined4s

import scala.compiletime.*

/** @author Kevin Lee
  * @since 2023-08-12
  */
trait InlinedRefined[A] extends RefinedBase[A] {

  inline val inlinedExpectedValue: String

  inline def inlinedPredicate(inline a: A): Boolean

  inline def apply(inline a: A): Type =
    inline if inlinedPredicate(a) then a.asInstanceOf[Type] // scalafix:ok DisableSyntax.asInstanceOf
    else error("Invalid value: [" + codeOf(a) + "]. It must be " + inlinedExpectedValue)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy