diff options
author | Philipp Haller <hallerp@gmail.com> | 2013-11-15 08:02:35 -0800 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2013-11-15 08:02:35 -0800 |
commit | c79ecacc9efc2799553ffc5bd53c8a0fc46662be (patch) | |
tree | bfc1eff35aad0af16f3beb9bbb25f6081821c5ac /src/main | |
parent | 8993b6b175947d9ed6339b6f3818b2c233fca64f (diff) | |
parent | 064392e9078b07e33abccd2753084d99d7db2068 (diff) | |
download | scala-async-c79ecacc9efc2799553ffc5bd53c8a0fc46662be.tar.gz scala-async-c79ecacc9efc2799553ffc5bd53c8a0fc46662be.tar.bz2 scala-async-c79ecacc9efc2799553ffc5bd53c8a0fc46662be.zip |
Merge pull request #44 from phaller/topic/cleanup-43
Clean-ups found during review of PR #43
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/scala/scala/async/internal/Lifter.scala | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/main/scala/scala/async/internal/Lifter.scala b/src/main/scala/scala/async/internal/Lifter.scala index 295eb3f..7b102d1 100644 --- a/src/main/scala/scala/async/internal/Lifter.scala +++ b/src/main/scala/scala/async/internal/Lifter.scala @@ -2,6 +2,7 @@ package scala.async.internal trait Lifter { self: AsyncMacro => + import scala.reflect.internal.Flags._ import global._ /** @@ -106,26 +107,21 @@ trait Lifter { val lifted = liftableSyms.map(symToTree).toList.map { t => + val sym = t.symbol val treeLifted = t match { case vd@ValDef(_, _, tpt, rhs) => - import reflect.internal.Flags._ - val sym = vd.symbol sym.setFlag(MUTABLE | STABLE | PRIVATE | LOCAL) sym.name = name.fresh(sym.name.toTermName) sym.modifyInfo(_.deconst) val zeroRhs = atPos(t.pos)(gen.mkZero(vd.symbol.info)) treeCopy.ValDef(vd, Modifiers(sym.flags), sym.name, TypeTree(sym.tpe).setPos(t.pos), zeroRhs) case dd@DefDef(_, _, tparams, vparamss, tpt, rhs) => - import reflect.internal.Flags._ - val sym = dd.symbol sym.name = this.name.fresh(sym.name.toTermName) sym.setFlag(PRIVATE | LOCAL) // Was `DefDef(sym, rhs)`, but this ran afoul of `ToughTypeSpec.nestedMethodWithInconsistencyTreeAndInfoParamSymbols` // due to the handling of type parameter skolems in `thisMethodType` in `Namers` treeCopy.DefDef(dd, Modifiers(sym.flags), sym.name, tparams, vparamss, tpt, rhs) case cd@ClassDef(_, _, tparams, impl) => - import reflect.internal.Flags._ - val sym = cd.symbol sym.name = newTypeName(name.fresh(sym.name.toString).toString) companionship.companionOf(cd.symbol) match { case NoSymbol => @@ -135,8 +131,6 @@ trait Lifter { } treeCopy.ClassDef(cd, Modifiers(sym.flags), sym.name, tparams, impl) case md@ModuleDef(_, _, impl) => - import reflect.internal.Flags._ - val sym = md.symbol companionship.companionOf(md.symbol) match { case NoSymbol => sym.name = name.fresh(sym.name.toTermName) @@ -145,8 +139,6 @@ trait Lifter { } treeCopy.ModuleDef(md, Modifiers(sym.flags), sym.name, impl) case td@TypeDef(_, _, tparams, rhs) => - import reflect.internal.Flags._ - val sym = td.symbol sym.name = newTypeName(name.fresh(sym.name.toString).toString) treeCopy.TypeDef(td, Modifiers(sym.flags), sym.name, tparams, rhs) } |