Skip to content

Commit 0c7dac7

Browse files
committed
Revert changes in ReifyQuotes
1 parent d49b293 commit 0c7dac7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class ReifyQuotes extends MacroTransform {
230230
def pickleAsTasty() = {
231231
val meth =
232232
if (isType) ref(defn.Unpickler_unpickleType).appliedToType(originalTp)
233-
else ref(defn.Unpickler_unpickleExpr).appliedToType(originalTp)
233+
else ref(defn.Unpickler_unpickleExpr).appliedToType(originalTp.widen)
234234
val spliceResType =
235235
if (isType) defn.QuotedTypeClass.typeRef.appliedTo(WildcardType)
236236
else defn.FunctionType(1, isContextual = true).appliedTo(defn.QuoteContextClass.typeRef, defn.QuotedExprClass.typeRef.appliedTo(defn.AnyType)) | defn.QuotedTypeClass.typeRef.appliedTo(WildcardType)
@@ -244,7 +244,10 @@ class ReifyQuotes extends MacroTransform {
244244
if (splices.isEmpty && body.symbol.isPrimitiveValueClass) tag(s"${body.symbol.name}Tag")
245245
else pickleAsTasty().select(nme.apply).appliedTo(qctx)
246246
}
247-
else pickleAsTasty()
247+
else toValue(body) match {
248+
case Some(value) => pickleAsValue(value)
249+
case _ => pickleAsTasty()
250+
}
248251
}
249252

250253
/** If inside a quote, split the body of the splice into a core and a list of embedded quotes

0 commit comments

Comments
 (0)