diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2008-04-21 12:52:11 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2008-04-21 12:52:11 +0000 |
commit | d17ec3325ae0f61493dfce8a311dcde26f7011a4 (patch) | |
tree | 31dde78a32cdc3d348633b3c94fc5af4489d1492 | |
parent | e744a804175228b9438db2eca4ea49bd52e6b32d (diff) | |
download | scala-d17ec3325ae0f61493dfce8a311dcde26f7011a4.tar.gz scala-d17ec3325ae0f61493dfce8a311dcde26f7011a4.tar.bz2 scala-d17ec3325ae0f61493dfce8a311dcde26f7011a4.zip |
Fixed deprecatio warnings when calling 'newName'.
8 files changed, 22 insertions, 22 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeGen.scala b/src/compiler/scala/tools/nsc/ast/TreeGen.scala index 6177d6d943..7a335a6c93 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeGen.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeGen.scala @@ -300,7 +300,7 @@ abstract class TreeGen { if (treeInfo.isPureExpr(expr)) { exprs1 += (() => expr) } else { - val temp = owner.newValue(expr.pos, unit.fresh.newName()) + val temp = owner.newValue(expr.pos, unit.fresh.newName(expr.pos)) .setFlag(SYNTHETIC).setInfo(expr.tpe) vdefs += ValDef(temp, expr) exprs1 += (() => Ident(temp) setType expr.tpe) diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index 0294ffeaf7..d975432bd2 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -1692,7 +1692,7 @@ abstract class GenICode extends SubComponent { case t @ Apply(fun, args) if (t.symbol.isLabel && !boundLabels(t.symbol)) => if (!labels.isDefinedAt(t.symbol)) { val oldLabel = t.symbol - val sym = method.newLabel(oldLabel.pos, unit.fresh.newName(oldLabel.name.toString)) + val sym = method.newLabel(oldLabel.pos, unit.fresh.newName(oldLabel.pos, oldLabel.name.toString)) sym.setInfo(oldLabel.tpe) labels(oldLabel) = sym } @@ -1701,7 +1701,7 @@ abstract class GenICode extends SubComponent { tree case t @ LabelDef(name, params, rhs) => - val name1 = unit.fresh.newName(name.toString) + val name1 = unit.fresh.newName(t.pos, name.toString) if (!labels.isDefinedAt(t.symbol)) { val oldLabel = t.symbol val sym = method.newLabel(oldLabel.pos, name1) @@ -1935,7 +1935,7 @@ abstract class GenICode extends SubComponent { /** Make a fresh local variable. It ensures the 'name' is unique. */ def makeLocal(pos: Position, tpe: Type, name: String): Local = { - val sym = method.symbol.newVariable(pos, unit.fresh.newName(name)) + val sym = method.symbol.newVariable(pos, unit.fresh.newName(pos, name)) .setInfo(tpe) .setFlag(Flags.SYNTHETIC) this.method.addLocal(new Local(sym, toTypeKind(tpe), false)) diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index 4e0e522508..42d9b36f98 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -633,7 +633,7 @@ trait ParallelMatching { assert(vlue.tpe ne null, "value tpe is null") val vs = strip1(column.head) val nsuccFst = rest.row.head match { case Row(pats,bnd,g,b) => Row(EmptyTree::pats, bnd.add(vs.elements, scrutinee),g,b) } - val fLabel = theOwner.newLabel(scrutinee.pos, cunit.fresh.newName("failCont%")) // warning, untyped + val fLabel = theOwner.newLabel(scrutinee.pos, cunit.fresh.newName(scrutinee.pos, "failCont%")) // warning, untyped val sx = rep.shortCut(fLabel) // register shortcut val nsuccRow = nsuccFst :: Row(getDummies( 1 /*scrutinee*/ + rest.temp.length), NoBinding, EmptyTree, sx) :: Nil @@ -1342,7 +1342,7 @@ trait ParallelMatching { } final def newVar(pos: Position, tpe: Type)(implicit theOwner: Symbol): Symbol = - newVar(pos, cunit.fresh.newName("temp"), tpe) setFlag symtab.Flags.SYNTHETIC + newVar(pos, cunit.fresh.newName(pos, "temp"), tpe) setFlag symtab.Flags.SYNTHETIC /** returns the condition in "if (cond) k1 else k2" */ diff --git a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala index 97dd2b6424..385c11e288 100644 --- a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala +++ b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala @@ -204,7 +204,7 @@ trait TransMatcher { self: transform.ExplicitOuter with PatternNodes with Parall var as = args while(as ne Nil) { val ti = as.head - val v = newVar(ti.pos, cunit.fresh.newName("tp"), selector.tpe.typeArgs(i)) + val v = newVar(ti.pos, cunit.fresh.newName(ti.pos, "tp"), selector.tpe.typeArgs(i)) if (!doCheckExhaustive) v.setFlag(symtab.Flags.TRANS_FLAG) vds += typedValDef(v, ti) diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index 3612a4d62e..59ba3f4e90 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -56,7 +56,7 @@ abstract class CleanUp extends Transform { val forName = getMember(ClassClass.linkedModuleOfClass, nme.forName) val owner = currentOwner.enclClass - val cvar = owner.newVariable(pos, unit.fresh.newName("class$Cache")) + val cvar = owner.newVariable(pos, unit.fresh.newName(pos, "class$Cache")) .setFlag(PRIVATE | STATIC | MUTABLE | SYNTHETIC).setInfo(ClassClass.tpe) owner.info.decls.enter(cvar) val cdef = @@ -66,7 +66,7 @@ abstract class CleanUp extends Transform { } } - val meth = owner.newMethod(pos, unit.fresh.newName("class$Method")) + val meth = owner.newMethod(pos, unit.fresh.newName(pos, "class$Method")) .setFlag(PRIVATE | STATIC | SYNTHETIC).setInfo(MethodType(List(), ClassClass.tpe)) owner.info.decls.enter(meth) val mdef = @@ -98,7 +98,7 @@ abstract class CleanUp extends Transform { case None => val owner = currentOwner.enclClass - val rmvar = owner.newVariable(pos, unit.fresh.newName("reflMethod$Cache")) + val rmvar = owner.newVariable(pos, unit.fresh.newName(pos, "reflMethod$Cache")) .setFlag(PRIVATE | STATIC | MUTABLE | SYNTHETIC) .setInfo(MethodClass.tpe) owner.info.decls.enter(rmvar) @@ -109,7 +109,7 @@ abstract class CleanUp extends Transform { } } - val rmcvar = owner.newVariable(pos, unit.fresh.newName("reflClass$Cache")) + val rmcvar = owner.newVariable(pos, unit.fresh.newName(pos, "reflClass$Cache")) .setFlag(PRIVATE | STATIC | MUTABLE | SYNTHETIC) .setInfo(ClassClass.tpe) owner.info.decls.enter(rmcvar) @@ -120,7 +120,7 @@ abstract class CleanUp extends Transform { } } - val rmmeth = owner.newMethod(pos, unit.fresh.newName("reflMethod$Method")) + val rmmeth = owner.newMethod(pos, unit.fresh.newName(pos, "reflMethod$Method")) .setFlag(STATIC | SYNTHETIC) .setInfo(MethodType(List(ClassClass.tpe), MethodClass.tpe)) owner.info.decls.enter(rmmeth) @@ -329,7 +329,7 @@ abstract class CleanUp extends Transform { gen.mkAttributedRef(BoxedUnit_UNIT) ) else if (resType.typeSymbol == ArrayClass) { - val sym = currentOwner.newValue(tree.pos, newTermName(unit.fresh.newName)) setInfo ObjectClass.tpe + val sym = currentOwner.newValue(tree.pos, newTermName(unit.fresh.newName(tree.pos))) setInfo ObjectClass.tpe Block( List(ValDef(sym, tree)), If( @@ -361,7 +361,7 @@ abstract class CleanUp extends Transform { (params zip paramTypes) map { case (param, paramType) => localTyper.typed { if (paramType.typeSymbol == ArrayClass) { - val sym = currentOwner.newValue(tree.pos, newTermName(unit.fresh.newName)) setInfo ObjectClass.tpe + val sym = currentOwner.newValue(tree.pos, newTermName(unit.fresh.newName(tree.pos))) setInfo ObjectClass.tpe val arrayType = { assert(paramType.typeArgs.length == 1) paramType.typeArgs(0).normalize @@ -410,7 +410,7 @@ abstract class CleanUp extends Transform { def callAsMethod(paramTypes: List[Type], resType: Type): Tree = localTyper.typed { val invokeExc = - currentOwner.newValue(tree.pos, newTermName(unit.fresh.newName)) setInfo InvocationTargetExceptionClass.tpe + currentOwner.newValue(tree.pos, newTermName(unit.fresh.newName(tree.pos))) setInfo InvocationTargetExceptionClass.tpe Try( Apply( Select( @@ -545,7 +545,7 @@ abstract class CleanUp extends Transform { case theTry @ Try(block, catches, finalizer) if theTry.tpe.typeSymbol != definitions.UnitClass && theTry.tpe.typeSymbol != definitions.AllClass => val tpe = theTry.tpe.widen - val tempVar = currentOwner.newValue(theTry.pos, unit.fresh.newName("exceptionResult")) + val tempVar = currentOwner.newValue(theTry.pos, unit.fresh.newName(theTry.pos, "exceptionResult")) .setInfo(tpe).setFlag(Flags.MUTABLE) val newBlock = super.transform(Block(Nil, Assign(Ident(tempVar), transform(block)))) diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala index 5afc6ac3ed..8e940f51df 100644 --- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala +++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala @@ -393,7 +393,7 @@ abstract class ExplicitOuter extends InfoTransform with TransMatcher with Patter case mch @ Match(selector, cases) => // <----- transmatch hook val tid = if (settings.debug.value) { - val q = unit.fresh.newName("tidmark") + val q = unit.fresh.newName(mch.pos, "tidmark") Console.println("transforming patmat with tidmark "+q+" ncases = "+cases.length) q } else null @@ -417,7 +417,7 @@ abstract class ExplicitOuter extends InfoTransform with TransMatcher with Patter def makeGuardDef(vs:SymList, guard:Tree) = { import symtab.Flags._ - val gdname = cunit.fresh.newName("gd") + val gdname = cunit.fresh.newName(guard.pos, "gd") val fmls = new ListBuffer[Type] val method = currentOwner.newMethod(mch.pos, gdname) setFlag (SYNTHETIC) var vs1 = vs; while (vs1 ne Nil) { diff --git a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala index 6b3be38c0a..84b0e5bb24 100644 --- a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala +++ b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala @@ -248,7 +248,7 @@ abstract class LambdaLift extends InfoTransform { if (sym.isAnonymousFunction && sym.owner.isMethod) sym.name.toString() + "$" + sym.owner.name.toString() + "$" else sym.name.toString() + "$" - sym.name = unit.fresh.newName(base) + sym.name = unit.fresh.newName(sym.pos, base) if (settings.debug.value) log("renamed: " + sym.name) } diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index af822968ba..04f7ae2eee 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -169,7 +169,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { private def nonLocalReturnKey(meth: Symbol) = nonLocalReturnKeys.get(meth) match { case Some(k) => k case None => - val k = meth.newValue(meth.pos, unit.fresh.newName("nonLocalReturnKey")) + val k = meth.newValue(meth.pos, unit.fresh.newName(meth.pos, "nonLocalReturnKey")) .setFlag(SYNTHETIC).setInfo(ObjectClass.tpe) nonLocalReturnKeys(meth) = k k @@ -403,7 +403,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { def liftTree(tree: Tree) = { if (settings.debug.value) log("lifting tree at: " + (tree.pos)) - val sym = currentOwner.newMethod(tree.pos, unit.fresh.newName("liftedTree")) + val sym = currentOwner.newMethod(tree.pos, unit.fresh.newName(tree.pos, "liftedTree")) sym.setInfo(MethodType(List(), tree.tpe)) new ChangeOwnerTraverser(currentOwner, sym).traverse(tree) localTyper.typed { @@ -547,7 +547,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { case Try(body, catches, finalizer) => if (catches forall treeInfo.isCatchCase) tree else { - val exname = unit.fresh.newName("ex$") + val exname = unit.fresh.newName(tree.pos, "ex$") val cases = if ((catches exists treeInfo.isDefaultCase) || (catches.last match { // bq: handle try { } catch { ... case ex:Throwable => ...} case CaseDef(Typed(Ident(nme.WILDCARD), tpt), EmptyTree, _) if (tpt.tpe =:= ThrowableClass.tpe) => |