@@ -323,48 +323,6 @@ trait Macros extends MacroRuntimes with Traces with Helpers {
323
323
fastTrackBoxity orElse bindingBoxity getOrElse false
324
324
}
325
325
326
- def computeMacroDefTypeFromMacroImplRef (macroDdef : DefDef , macroImplRef : Tree ): Type = {
327
- def computeIt (macroImpl : Symbol , targs : List [Tree ]): Type = {
328
- // Step I. Transform c.Expr[T] to T and everything else to Any
329
- val runtimeType0 = decreaseMetalevel(macroImpl.info.finalResultType)
330
-
331
- // Step II. Transform type parameters of a macro implementation into type arguments in a macro definition's body
332
- val runtimeType = runtimeType0.substituteTypes(macroImpl.typeParams, targs.map(_.tpe))
333
-
334
- // Step III. Transform c.prefix.value.XXX to this.XXX and implParam.value.YYY to defParam.YYY
335
- def unsigma (tpe : Type ): Type =
336
- transformTypeTagEvidenceParams(macroImplRef, (param, tparam) => NoSymbol ) match {
337
- case (implCtxParam :: Nil ) :: implParamss =>
338
- val implToDef = flatMap2(implParamss, macroDdef.vparamss)(map2(_, _)((_, _))).toMap
339
- object UnsigmaTypeMap extends TypeMap {
340
- def apply (tp : Type ): Type = tp match {
341
- case TypeRef (pre, sym, args) =>
342
- val pre1 = pre match {
343
- case SingleType (SingleType (SingleType (NoPrefix , c), prefix), value) if c == implCtxParam && prefix == MacroContextPrefix && value == ExprValue =>
344
- ThisType (macroDdef.symbol.owner)
345
- case SingleType (SingleType (NoPrefix , implParam), value) if value == ExprValue =>
346
- implToDef get implParam map (defParam => SingleType (NoPrefix , defParam.symbol)) getOrElse pre
347
- case _ =>
348
- pre
349
- }
350
- val args1 = args map mapOver
351
- TypeRef (pre1, sym, args1)
352
- case _ =>
353
- mapOver(tp)
354
- }
355
- }
356
- UnsigmaTypeMap (tpe)
357
- case _ =>
358
- tpe
359
- }
360
- unsigma(runtimeType)
361
- }
362
- macroImplRef match {
363
- case MacroImplReference (_, _, _, macroImpl, targs) => computeIt(macroImpl, targs)
364
- case _ => ErrorType
365
- }
366
- }
367
-
368
326
/** Verifies that the body of a macro def typechecks to a reference to a static public non-overloaded method or a top-level macro bundle,
369
327
* and that that method is signature-wise compatible with the given macro definition.
370
328
*
0 commit comments