import scala.compiletime.{error, requireConst} opaque type NonEmptyString = String object NonEmptyString: def apply(s: String): Option[NonEmptyString] = if s.isEmpty then None else Some(s) inline def from(inline s: String): NonEmptyString = requireConst(s) inline if s == "" then error("got an empty string") else s given Conversion[NonEmptyString, String] with inline def apply(nes: NonEmptyString): String = nes