Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/src/scala/quoted/Expr.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package scala.quoted

import scala.runtime.quoted.Unpickler.Pickled

sealed abstract class Expr[T] {
sealed abstract class Expr[+T] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd make sense to make the subclasses covariant too for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will add apt them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #4896

final def unary_~ : T = throw new Error("~ should have been compiled away")

/** Evaluate the contents of this expression and return the result.
Expand Down
5 changes: 5 additions & 0 deletions tests/pos/i4891.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import scala.quoted._

object Test {
def foo: Expr[Option[String]] = '(None)
}