@@ -155,10 +155,9 @@ class ReifyQuotes extends MacroTransform {
155
155
*/
156
156
def pickleAsLiteral (lit : Literal ) = {
157
157
val exprType = defn.QuotedExprClass .typeRef.appliedTo(body.tpe)
158
- val tpe = MethodType (defn.QuoteContextClass .typeRef :: Nil , exprType)
159
- val meth = newSymbol(ctx.owner, UniqueName .fresh(nme.ANON_FUN ), Synthetic | Method , tpe)
160
- def mkConst (tss : List [List [Tree ]]) = {
161
- val reflect = tss.head.head.select(" reflect" .toTermName)
158
+ val lambdaTpe = MethodType (defn.QuoteContextClass .typeRef :: Nil , exprType)
159
+ def mkConst (ts : List [Tree ]) = {
160
+ val reflect = ts.head.select(" reflect" .toTermName)
162
161
val typeName = body.tpe.typeSymbol.name
163
162
val literalValue =
164
163
if lit.const.tag == Constants .NullTag || lit.const.tag == Constants .UnitTag then Nil
@@ -167,7 +166,7 @@ class ReifyQuotes extends MacroTransform {
167
166
val literal = reflect.select(" Literal" .toTermName).select(nme.apply).appliedTo(constant)
168
167
reflect.select(" TreeMethods" .toTermName).select(" asExpr" .toTermName).appliedTo(literal).asInstance(exprType)
169
168
}
170
- Closure (meth , mkConst).withSpan(body.span)
169
+ Lambda (lambdaTpe , mkConst).withSpan(body.span)
171
170
}
172
171
173
172
def pickleAsValue (lit : Literal ) = {
@@ -229,14 +228,13 @@ class ReifyQuotes extends MacroTransform {
229
228
def taggedType () =
230
229
val typeType = defn.QuotedTypeClass .typeRef.appliedTo(body.tpe)
231
230
val classTree = TypeApply (ref(defn.Predef_classOf .termRef), body :: Nil )
232
- val tpe = MethodType (defn.QuoteContextClass .typeRef :: Nil , typeType)
233
- val meth = newSymbol(ctx.owner, UniqueName .fresh(nme.ANON_FUN ), Synthetic | Method , tpe)
234
- def mkConst (tss : List [List [Tree ]]) = {
235
- val reflect = tss.head.head.select(" reflect" .toTermName)
231
+ val lambdaTpe = MethodType (defn.QuoteContextClass .typeRef :: Nil , typeType)
232
+ def callTypeConstructorOf (ts : List [Tree ]) = {
233
+ val reflect = ts.head.select(" reflect" .toTermName)
236
234
val typeRepr = reflect.select(" TypeRepr" .toTermName).select(" typeConstructorOf" .toTermName).appliedTo(classTree)
237
235
reflect.select(" TypeReprMethods" .toTermName).select(" asType" .toTermName).appliedTo(typeRepr).asInstance(typeType)
238
236
}
239
- Closure (meth, mkConst ).withSpan(body.span)
237
+ Lambda (lambdaTpe, callTypeConstructorOf ).withSpan(body.span)
240
238
241
239
if (isType) {
242
240
if (splices.isEmpty && body.symbol.isPrimitiveValueClass) taggedType()
0 commit comments