We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
null
StringUnliftable
1 parent 693b818 commit 941410dCopy full SHA for 941410d
library/src-bootstrapped/scala/quoted/Unliftable.scala
@@ -83,7 +83,7 @@ object Unliftable {
83
def fromExpr(expr: Expr[T]) =
84
import quotes.reflect._
85
def rec(tree: Term): Option[T] = tree match {
86
- case Literal(c) => Some(c.value.asInstanceOf[T])
+ case Literal(c) if c.value != null => Some(c.value.asInstanceOf[T])
87
case Block(Nil, e) => rec(e)
88
case Typed(e, _) => rec(e)
89
case Inlined(_, Nil, e) => rec(e)
tests/run-staging/unliftables.check
@@ -38,7 +38,7 @@ Some(Some(3))
38
Some(None)
39
Some(Some(3))
40
41
-Some(None)
+None
42
43
Some(Left(1))
44
Some(Right(2))
0 commit comments