File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/transform
library/src/scala/runtime/quoted Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -229,9 +229,12 @@ class ReifyQuotes extends MacroTransform {
229229 val meth =
230230 if (isType) ref(defn.Unpickler_unpickleType ).appliedToType(originalTp)
231231 else ref(defn.Unpickler_unpickleExpr ).appliedToType(originalTp.widen)
232+ val spliceResType =
233+ if (isType) defn.QuotedTypeType .appliedTo(WildcardType )
234+ else defn.QuotedExprType .appliedTo(defn.AnyType ) | defn.QuotedTypeType .appliedTo(WildcardType )
232235 meth.appliedTo(
233236 liftList(PickledQuotes .pickleQuote(body).map(x => Literal (Constant (x))), defn.StringType ),
234- liftList(splices, defn.AnyType ))
237+ liftList(splices, defn.FunctionType ( 1 ).appliedTo(defn. SeqType .appliedTo(defn. AnyType ), spliceResType) ))
235238 }
236239 if (splices.nonEmpty) pickleAsTasty()
237240 else if (isType) {
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ object Unpickler {
1414 /** Unpickle `repr` which represents a pickled `Expr` tree,
1515 * replacing splice nodes with `args`
1616 */
17- def unpickleExpr [T ](repr : Pickled , args : Seq [Any ]): Expr [T ] = new TastyExpr [T ](repr, args)
17+ def unpickleExpr [T ](repr : Pickled , args : Seq [Seq [ Any ] => ( Expr [ Any ] | Type [_]) ]): Expr [T ] = new TastyExpr [T ](repr, args)
1818
1919 /** Unpickle `repr` which represents a pickled `Type` tree,
2020 * replacing splice nodes with `args`
2121 */
22- def unpickleType [T ](repr : Pickled , args : Seq [Any ]): Type [T ] = new TastyType [T ](repr, args)
22+ def unpickleType [T ](repr : Pickled , args : Seq [Seq [ Any ] => Type [_] ]): Type [T ] = new TastyType [T ](repr, args)
2323}
You can’t perform that action at this time.
0 commit comments