Skip to content

Commit 8c4e959

Browse files
committed
make literals final
1 parent 06309af commit 8c4e959

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main/scala/tyql/expr/Expr.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -620,41 +620,41 @@ object Expr:
620620

621621
case class Cast[A, B, S <: ExprShape]($x: Expr[A, S], resultType: CastTarget)(using ResultTag[B]) extends Expr[B, S]
622622

623-
case class NullLit[A]()(using ResultTag[A]) extends Expr[A, NonScalarExpr] with LiteralExpression
623+
final case class NullLit[A]()(using ResultTag[A]) extends Expr[A, NonScalarExpr] with LiteralExpression
624624
case class IsNull[A, S <: ExprShape]($x: Expr[A, S]) extends Expr[Boolean, S]
625625
case class Coalesce[A, S1 <: ExprShape]($x1: Expr[A, S1], $x2: Expr[A, S1], $xs: Seq[Expr[A, S1]])(using ResultTag[A])
626626
extends Expr[A, S1]
627627
case class NullIf[A, S1 <: ExprShape, S2 <: ExprShape]($x: Expr[A, S1], $y: Expr[A, S2])(using ResultTag[A])
628628
extends Expr[A, CalculatedShape[S1, S2]]
629629

630-
case class LocalDateLit($value: java.time.LocalDate) extends Expr[java.time.LocalDate, NonScalarExpr]
630+
final case class LocalDateLit($value: java.time.LocalDate) extends Expr[java.time.LocalDate, NonScalarExpr]
631631
with LiteralExpression
632632
given Conversion[java.time.LocalDate, LocalDateLit] = LocalDateLit(_)
633633
case class LocalDateTimeLit($value: java.time.LocalDateTime) extends Expr[java.time.LocalDateTime, NonScalarExpr]
634634
with LiteralExpression
635635
given Conversion[java.time.LocalDateTime, LocalDateTimeLit] = LocalDateTimeLit(_)
636636

637637
/** Literals are type-specific, tailored to the types that the DB supports */
638-
case class BytesLit($value: Array[Byte]) extends Expr[Array[Byte], NonScalarExpr]
639-
case class ByteStreamLit($value: () => java.io.InputStream) extends Expr[() => java.io.InputStream, NonScalarExpr]
638+
final case class BytesLit($value: Array[Byte]) extends Expr[Array[Byte], NonScalarExpr]
639+
final case class ByteStreamLit($value: () => java.io.InputStream) extends Expr[() => java.io.InputStream, NonScalarExpr]
640640

641-
case class IntLit($value: Int) extends Expr[Int, NonScalarExpr] with LiteralExpression
642-
case class LongLit($value: Long) extends Expr[Long, NonScalarExpr] with LiteralExpression
641+
final case class IntLit($value: Int) extends Expr[Int, NonScalarExpr] with LiteralExpression
642+
final case class LongLit($value: Long) extends Expr[Long, NonScalarExpr] with LiteralExpression
643643

644644
/** Scala values can be lifted into literals by conversions */
645645
given Conversion[Int, IntLit] = IntLit(_)
646646
given Conversion[Long, LongLit] = LongLit(_)
647647

648-
case class StringLit($value: String) extends Expr[String, NonScalarExpr] with LiteralExpression
648+
final case class StringLit($value: String) extends Expr[String, NonScalarExpr] with LiteralExpression
649649
given Conversion[String, StringLit] = StringLit(_)
650650

651-
case class DoubleLit($value: Double) extends Expr[Double, NonScalarExpr] with LiteralExpression
651+
final case class DoubleLit($value: Double) extends Expr[Double, NonScalarExpr] with LiteralExpression
652652
given Conversion[Double, DoubleLit] = DoubleLit(_)
653653

654-
case class FloatLit($value: Float) extends Expr[Float, NonScalarExpr] with LiteralExpression
654+
final case class FloatLit($value: Float) extends Expr[Float, NonScalarExpr] with LiteralExpression
655655
given Conversion[Float, FloatLit] = FloatLit(_)
656656

657-
case class BooleanLit($value: Boolean) extends Expr[Boolean, NonScalarExpr] with LiteralExpression
657+
final case class BooleanLit($value: Boolean) extends Expr[Boolean, NonScalarExpr] with LiteralExpression
658658
// given Conversion[Boolean, BooleanLit] = BooleanLit(_) // XXX this one breaks everything by inlining complex expressions as FALSE everywhere
659659

660660
def randomFloat(): Expr[Double, NonScalarExpr] = RandomFloat()

0 commit comments

Comments
 (0)