summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2011-02-01 16:18:20 +0000
committerIulian Dragos <jaguarul@gmail.com>2011-02-01 16:18:20 +0000
commitcaf436d96fda91365295035297bbf8cec4bd4da1 (patch)
tree55bba64709329c3bc9650292dc331a11ba0477b4
parent589b8a5d536da8c41bcaeee4aff382828fd9253d (diff)
downloadscala-caf436d96fda91365295035297bbf8cec4bd4da1.tar.gz
scala-caf436d96fda91365295035297bbf8cec4bd4da1.tar.bz2
scala-caf436d96fda91365295035297bbf8cec4bd4da1.zip
Cleared 'createdSyntheticMethod' on resetTyper ...
Cleared 'createdSyntheticMethod' on resetTyper (another leak in the presentation compiler). review by extempore.
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala7
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
index c406f8cca9..c855abd7fb 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
@@ -41,9 +41,16 @@ trait SyntheticMethods extends ast.TreeDSL {
* associated badness: see ticket #883. So if it sees such a thing this has happened
* (by virtue of the symbol being in createdMethodSymbols) it re-overrides it with
* reference equality.
+ *
+ * TODO: remove once (deprecated) case class inheritance is dropped form nsc.
*/
private val createdMethodSymbols = new mutable.HashSet[Symbol]
+ /** Clear the cache of createdMethodSymbols. */
+ def resetSynthetics() {
+ createdMethodSymbols.clear()
+ }
+
/** Add the synthetic methods to case classes. Note that a lot of the
* complexity herein is a consequence of case classes inheriting from
* case classes, which has been deprecated as of Sep 11 2009. So when
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index b211c20f41..ce0673196a 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -45,10 +45,12 @@ trait Typers extends Modes {
final val shortenImports = false
def resetTyper() {
+ //println("resetTyper called")
resetContexts()
resetNamer()
resetImplicits()
transformed.clear()
+ resetSynthetics()
}
object UnTyper extends Traverser {