summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-01-15 11:33:54 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-01-15 15:36:02 +1000
commit70ed23d58f9dd2d198250d2a889b60c88e39f59a (patch)
tree05865d9fe680629642f94fcf855d39ad56a41f6a /src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
parent05612399f78f34cb01fb31070eacf4a51b489dfb (diff)
downloadscala-70ed23d58f9dd2d198250d2a889b60c88e39f59a.tar.gz
scala-70ed23d58f9dd2d198250d2a889b60c88e39f59a.tar.bz2
scala-70ed23d58f9dd2d198250d2a889b60c88e39f59a.zip
SI-9089 Another REPL/FSC + specialization bug fix
The enclosed test case stopped working in 2.11.5 on the back of https://github.com/scala/scala/pull/4040. The key change was that we ran all post-typer info transformers on each run of the compiler, rather than trying to reuse the results of the previous run. In that patch, I noticed one place [1] in specialization that aggressively entered specialized members into the owning scope, rather than relying on `transformInfo` to place the new members in the scope of the newly created element of the info history. I made that change after noticing that this code could actually mutated scopes of specializaed types at the parser phase, which led to fairly obscure failures. This bug is another one of these obscure failures, and has the same root cause. We effectively "double specialiaze" Function0, which trips an assertion when `method apply$mcI$sp` is found twice in a scope. I have found another spot that was directly manipulating the scope, and removed the offending code. [1] https://github.com/scala/scala/pull/4040#commitcomment-8531516
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
index 9c81e31ad9..5a31e20bf8 100644
--- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
+++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
@@ -894,7 +894,6 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
}
val specMember = subst(outerEnv)(specializedOverload(owner, sym, spec))
- owner.info.decls.enter(specMember)
typeEnv(specMember) = typeEnv(sym) ++ outerEnv ++ spec
wasSpecializedForTypeVars(specMember) ++= spec collect { case (s, tp) if s.tpe == tp => s }