@@ -291,9 +291,6 @@ object PickleQuotes {
291
291
* this closure is always applied directly to the actual context and the BetaReduce phase removes it.
292
292
*/
293
293
def pickleAsTasty () = {
294
-
295
- val unpickleV1 = ctx.scalaRelease <= Release3_1
296
-
297
294
val pickleQuote = PickledQuotes .pickleQuote(body)
298
295
val pickledQuoteStrings = pickleQuote match
299
296
case x :: Nil => Literal (Constant (x))
@@ -306,26 +303,8 @@ object PickleQuotes {
306
303
307
304
// This and all closures in typeSplices are removed by the BetaReduce phase
308
305
val types =
309
- if unpickleV1 then
310
- if typeSplices.isEmpty then Literal (Constant (null )) // keep pickled quote without contents as small as possible
311
- else
312
- Lambda (
313
- MethodType (
314
- List (nme.idx, nme.contents).map(name => UniqueName .fresh(name).toTermName),
315
- List (defn.IntType , defn.SeqType .appliedTo(defn.AnyType )),
316
- defn.QuotedTypeClass .typeRef.appliedTo(WildcardType )),
317
- args => {
318
- val cases = typeSplices.map { case (splice, idx) =>
319
- CaseDef (Literal (Constant (idx)), EmptyTree , splice)
320
- }
321
- cases match
322
- case CaseDef (_, _, rhs) :: Nil => rhs
323
- case _ => Match (args(0 ).annotated(New (ref(defn.UncheckedAnnot .typeRef))), cases)
324
- }
325
- )
326
- else // if unpickleV2 then
327
- if typeSplices.isEmpty then Literal (Constant (null )) // keep pickled quote without contents as small as possible
328
- else SeqLiteral (typeSplices.map(_._1), TypeTree (defn.QuotedTypeClass .typeRef.appliedTo(WildcardType )))
306
+ if typeSplices.isEmpty then Literal (Constant (null )) // keep pickled quote without contents as small as possible
307
+ else SeqLiteral (typeSplices.map(_._1), TypeTree (defn.QuotedTypeClass .typeRef.appliedTo(WildcardType )))
329
308
330
309
// This and all closures in termSplices are removed by the BetaReduce phase
331
310
val termHoles =
@@ -341,12 +320,7 @@ object PickleQuotes {
341
320
val defn .FunctionOf (argTypes, defn.FunctionOf (quotesType :: _, _, _, _), _, _) = splice.tpe
342
321
val rhs = {
343
322
val spliceArgs = argTypes.zipWithIndex.map { (argType, i) =>
344
- val argi = args(1 ).select(nme.apply).appliedTo(Literal (Constant (i)))
345
- if unpickleV1 && argType.derivesFrom(defn.QuotedExprClass ) then
346
- val argType1 = defn.FunctionType (1 ).appliedTo(defn.QuotesClass .typeRef, argType)
347
- argi.asInstance(argType1).select(nme.apply).appliedTo(args(2 ))
348
- else
349
- argi.asInstance(argType)
323
+ args(1 ).select(nme.apply).appliedTo(Literal (Constant (i))).asInstance(argType)
350
324
}
351
325
val Block (List (ddef : DefDef ), _) = splice
352
326
// TODO: beta reduce inner closure? Or wait until BetaReduce phase?
@@ -363,14 +337,10 @@ object PickleQuotes {
363
337
val quotedType = quoteClass.typeRef.appliedTo(originalTp)
364
338
val lambdaTpe = MethodType (defn.QuotesClass .typeRef :: Nil , quotedType)
365
339
val unpickleMeth =
366
- if unpickleV1 then
367
- if isType then defn.QuoteUnpickler_unpickleType
368
- else defn.QuoteUnpickler_unpickleExpr
369
- else // if unpickleV2 then
370
- if isType then defn.QuoteUnpickler_unpickleTypeV2
371
- else defn.QuoteUnpickler_unpickleExprV2
340
+ if isType then defn.QuoteUnpickler_unpickleTypeV2
341
+ else defn.QuoteUnpickler_unpickleExprV2
372
342
val unpickleArgs =
373
- if isType && ! unpickleV1 then List (pickledQuoteStrings, types)
343
+ if isType then List (pickledQuoteStrings, types)
374
344
else List (pickledQuoteStrings, types, termHoles)
375
345
quotes
376
346
.asInstance(defn.QuoteUnpicklerClass .typeRef)
0 commit comments