Skip to content

Commit 941410d

Browse files
committed
Do not match null in StringUnliftable
1 parent 693b818 commit 941410d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/src-bootstrapped/scala/quoted/Unliftable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ object Unliftable {
8383
def fromExpr(expr: Expr[T]) =
8484
import quotes.reflect._
8585
def rec(tree: Term): Option[T] = tree match {
86-
case Literal(c) => Some(c.value.asInstanceOf[T])
86+
case Literal(c) if c.value != null => Some(c.value.asInstanceOf[T])
8787
case Block(Nil, e) => rec(e)
8888
case Typed(e, _) => rec(e)
8989
case Inlined(_, Nil, e) => rec(e)

tests/run-staging/unliftables.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Some(Some(3))
3838
Some(None)
3939
Some(Some(3))
4040
Some(Some(3))
41-
Some(None)
41+
None
4242

4343
Some(Left(1))
4444
Some(Right(2))

0 commit comments

Comments
 (0)