Skip to content

Commit c90d288

Browse files
committed
Contextualize pickled type quotes
1 parent 34e26d3 commit c90d288

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,10 @@ class ReifyQuotes extends MacroTransform {
239239
meth.appliedTo(pickledQuoteStrings, splicesList)
240240
}
241241

242-
if (splices.nonEmpty) pickleAsTasty()
243-
else if (isType) {
242+
if (isType) {
244243
def tag(tagName: String) = ref(defn.QuotedTypeModule).select(tagName.toTermName).appliedTo(qctx)
245-
if (body.symbol.isPrimitiveValueClass) tag(s"${body.symbol.name}Tag")
246-
else pickleAsTasty()
244+
if (splices.isEmpty && body.symbol.isPrimitiveValueClass) tag(s"${body.symbol.name}Tag")
245+
else pickleAsTasty().select(nme.apply).appliedTo(qctx)
247246
}
248247
else toValue(body) match {
249248
case Some(value) => pickleAsValue(value)

library/src/scala/runtime/quoted/Unpickler.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ object Unpickler {
1919
/** Unpickle `repr` which represents a pickled `Type` tree,
2020
* replacing splice nodes with `args`
2121
*/
22-
def unpickleType[T](repr: Pickled, args: Seq[Seq[Any] => Type[_]]): Type[T] = new TastyType[T](repr, args)
22+
def unpickleType[T](repr: Pickled, args: Seq[Seq[Any] => Type[_]]): given QuoteContext => Type[T] = new TastyType[T](repr, args)
23+
2324
}

0 commit comments

Comments
 (0)