@@ -206,17 +206,23 @@ class ReifyQuotes extends MacroTransform {
206
206
qctx
207
207
}
208
208
209
- def pickleAsLiteral (lit : Literal ) =
209
+ def pickleAsLiteral (lit : Literal ) = {
210
+ def liftedValue (lifter : Symbol ) =
211
+ ref(lifter).appliedToType(originalTp).select(nme.toExpr).appliedTo(lit)
210
212
lit.const.tag match {
211
213
case Constants .NullTag => ref(defn.QuotedExprModule_nullExpr )
212
214
case Constants .UnitTag => ref(defn.QuotedExprModule_unitExpr )
213
- case _ => // Lifted literal
214
- val ltp = defn.LiftableClass .typeRef.appliedTo(ConstantType (lit.const))
215
- val liftable = ctx.typer.inferImplicitArg(ltp, body.span)
216
- if (liftable.tpe.isInstanceOf [SearchFailureType ])
217
- ctx.error(ctx.typer.missingArgMsg(liftable, ltp, " Could no optimize constant in quote" ), ctx.source.atSpan(body.span))
218
- liftable.select(nme.toExpr).appliedTo(lit)
215
+ case Constants .BooleanTag => liftedValue(defn.LiftableModule_BooleanIsLiftable )
216
+ case Constants .ByteTag => liftedValue(defn.LiftableModule_ByteIsLiftable )
217
+ case Constants .ShortTag => liftedValue(defn.LiftableModule_ShortIsLiftable )
218
+ case Constants .IntTag => liftedValue(defn.LiftableModule_IntIsLiftable )
219
+ case Constants .LongTag => liftedValue(defn.LiftableModule_LongIsLiftable )
220
+ case Constants .FloatTag => liftedValue(defn.LiftableModule_FloatIsLiftable )
221
+ case Constants .DoubleTag => liftedValue(defn.LiftableModule_DoubleIsLiftable )
222
+ case Constants .CharTag => liftedValue(defn.LiftableModule_CharIsLiftable )
223
+ case Constants .StringTag => liftedValue(defn.LiftableModule_StringIsLiftable )
219
224
}
225
+ }
220
226
221
227
def pickleAsTasty () = {
222
228
val meth =
0 commit comments