Skip to content

Commit 6b27cb6

Browse files
committed
Fix #4891: Make scala.quoted.Expr covariant
1 parent 429c1f2 commit 6b27cb6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

library/src/scala/quoted/Expr.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package scala.quoted
22

33
import scala.runtime.quoted.Unpickler.Pickled
44

5-
sealed abstract class Expr[T] {
5+
sealed abstract class Expr[+T] {
66
final def unary_~ : T = throw new Error("~ should have been compiled away")
77

88
/** Evaluate the contents of this expression and return the result.

tests/pos/i4891.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import scala.quoted._
2+
3+
object Test {
4+
def foo: Expr[Option[String]] = '(None)
5+
}

0 commit comments

Comments
 (0)