diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-02-21 22:52:33 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-02-21 22:52:33 +0100 |
commit | dded01b234542501fa62821376a4d853e24250d4 (patch) | |
tree | ee646694bba9bc82875af390025235b009cc5096 /src | |
parent | fb0c25c7fd004ee5de1a910bdcccc4fd503da3ce (diff) | |
download | scala-dded01b234542501fa62821376a4d853e24250d4.tar.gz scala-dded01b234542501fa62821376a4d853e24250d4.tar.bz2 scala-dded01b234542501fa62821376a4d853e24250d4.zip |
more clean up in the macro engine
Now when SI-7507 is fixed in starr, we can actually remove a workaround
and make a 10 line reduction in the size of Resolvers.scala.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/reflect/macros/compiler/Resolvers.scala | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/compiler/scala/reflect/macros/compiler/Resolvers.scala b/src/compiler/scala/reflect/macros/compiler/Resolvers.scala index 05e229c51c..4484c234aa 100644 --- a/src/compiler/scala/reflect/macros/compiler/Resolvers.scala +++ b/src/compiler/scala/reflect/macros/compiler/Resolvers.scala @@ -25,22 +25,11 @@ trait Resolvers { typer.silent(_.typed(markMacroImplRef(core)), reportAmbiguousErrors = false).nonEmpty } - lazy val macroImplRef: Tree = + lazy val (macroImplRef, isBlackbox, macroImplOwner, macroImpl, targs) = typer.silent(_.typed(markMacroImplRef(untypedMacroImplRef)), reportAmbiguousErrors = false) match { - case SilentResultValue(success) => success + case SilentResultValue(macroImplRef @ MacroImplReference(_, isBlackbox, owner, meth, targs)) => (macroImplRef, isBlackbox, owner, meth, targs) + case SilentResultValue(macroImplRef) => MacroImplReferenceWrongShapeError() case SilentTypeError(err) => abort(err.errPos, err.errMsg) } - - // FIXME: cannot write this concisely because of SI-7507 - // lazy val (_, macroImplOwner, macroImpl, macroImplTargs) = - private lazy val dissectedMacroImplRef = - macroImplRef match { - case MacroImplReference(_, isBlackbox, owner, meth, targs) => (isBlackbox, owner, meth, targs) - case _ => MacroImplReferenceWrongShapeError() - } - lazy val isBlackbox = dissectedMacroImplRef._1 - lazy val macroImplOwner = dissectedMacroImplRef._2 - lazy val macroImpl = dissectedMacroImplRef._3 - lazy val targs = dissectedMacroImplRef._4 } } |