Skip to content

Commit 48a4daa

Browse files
authored
Merge pull request #4896 from dotty-staging/fix-#4891
Make subclasses of scala.quoted.Expr covariant
2 parents f4de761 + 0743f7b commit 48a4daa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/src/scala/quoted/Expr.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ object Expr {
3131
*/
3232
object Exprs {
3333
/** An Expr backed by a pickled TASTY tree */
34-
final class TastyExpr[T](val tasty: Pickled, val args: Seq[Any]) extends Expr[T] {
34+
final class TastyExpr[+T](val tasty: Pickled, val args: Seq[Any]) extends Expr[T] {
3535
override def toString: String = s"Expr(<pickled tasty>)"
3636
}
3737

3838
/** An Expr backed by a lifted value.
3939
* Values can only be of type Boolean, Byte, Short, Char, Int, Long, Float, Double, Unit, String or Null.
4040
*/
41-
final class LiftedExpr[T](val value: T) extends Expr[T] {
41+
final class LiftedExpr[+T](val value: T) extends Expr[T] {
4242
override def toString: String = s"Expr($value)"
4343
}
4444

@@ -54,7 +54,7 @@ object Exprs {
5454
}
5555

5656
/** An Expr representing `'{(~f).apply(~x)}` but it is beta-reduced when the closure is known */
57-
final class FunctionAppliedTo[T, U](val f: Expr[T => U], val x: Expr[T]) extends Expr[U] {
57+
final class FunctionAppliedTo[T, +U](val f: Expr[T => U], val x: Expr[T]) extends Expr[U] {
5858
override def toString: String = s"Expr($f <applied to> $x)"
5959
}
6060
}

0 commit comments

Comments
 (0)