summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-08-19 02:44:43 +0200
committerVlad Ureche <vlad.ureche@gmail.com>2012-08-19 02:44:43 +0200
commitc17c95ca3fffc35ed251e95ec321a1c67038f9f8 (patch)
tree26da24fb5a9bb5f87c537e4fae111d4c5ed2209d /src/compiler
parentaf19824ab993e5a4f9d09fe76793dbc7795432cf (diff)
downloadscala-c17c95ca3fffc35ed251e95ec321a1c67038f9f8.tar.gz
scala-c17c95ca3fffc35ed251e95ec321a1c67038f9f8.tar.bz2
scala-c17c95ca3fffc35ed251e95ec321a1c67038f9f8.zip
SI-5788 correct test and symbol update
Previously I thought it's fixed because I didn't include the correct testcase. Now it's the correct testcase and this prompted me to change the code a bit to make it work properly.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Duplicators.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
index e590e7aa30..070f083a89 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
@@ -283,14 +283,15 @@ abstract class Duplicators extends Analyzer {
// the typer does not create the symbols for a LabelDef's params, so unless they were created before we need
// to do it manually here -- but for the tailcalls-generated labels, ValDefs are created before the LabelDef,
- // so we just need to plug in the name
+ // so we just need to change the tree to point to the updated symbols
def newParam(p: Tree): Ident =
if (isTailLabel)
- Ident(p.symbol.name) // let the typer pick up the right symbol
+ Ident(updateSym(p.symbol))
else {
val newsym = p.symbol.cloneSymbol //(context.owner) // TODO owner?
Ident(newsym.setInfo(fixType(p.symbol.info)))
}
+
val params1 = params map newParam
val rhs1 = (new TreeSubstituter(params map (_.symbol), params1) transform rhs) // TODO: duplicate?
rhs1.tpe = null