File tree 2 files changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/transform
library/src/scala/runtime/quoted 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 {
229
229
val meth =
230
230
if (isType) ref(defn.Unpickler_unpickleType ).appliedToType(originalTp)
231
231
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 )
232
235
meth.appliedTo(
233
236
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) ))
235
238
}
236
239
if (splices.nonEmpty) pickleAsTasty()
237
240
else if (isType) {
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ object Unpickler {
14
14
/** Unpickle `repr` which represents a pickled `Expr` tree,
15
15
* replacing splice nodes with `args`
16
16
*/
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)
18
18
19
19
/** Unpickle `repr` which represents a pickled `Type` tree,
20
20
* replacing splice nodes with `args`
21
21
*/
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)
23
23
}
You can’t perform that action at this time.
0 commit comments