diff options
author | Vlad Ureche <vlad.ureche@gmail.com> | 2012-08-19 02:44:43 +0200 |
---|---|---|
committer | Vlad Ureche <vlad.ureche@gmail.com> | 2012-08-19 02:44:43 +0200 |
commit | c17c95ca3fffc35ed251e95ec321a1c67038f9f8 (patch) | |
tree | 26da24fb5a9bb5f87c537e4fae111d4c5ed2209d | |
parent | af19824ab993e5a4f9d09fe76793dbc7795432cf (diff) | |
download | scala-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.
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Duplicators.scala | 5 | ||||
-rw-r--r-- | test/files/pos/SI-5788.scala | 5 |
2 files changed, 5 insertions, 5 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 diff --git a/test/files/pos/SI-5788.scala b/test/files/pos/SI-5788.scala index 93b84bde87..f292461804 100644 --- a/test/files/pos/SI-5788.scala +++ b/test/files/pos/SI-5788.scala @@ -1,4 +1,3 @@ -trait Test { - trait B[T] - private final def grow[T](): B[T] = grow[T]() +trait Foo[@specialized(Int) A] { + final def bar(a:A):A = bar(a) } |