diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-01-20 16:57:39 +0300 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-01-20 16:57:39 +0300 |
commit | 3f3014cf0edd8ea182d234d5987838223231d9c9 (patch) | |
tree | 1a290508ea9c3eb0ba42306101ccb454f6e66334 | |
parent | 554fc3e71481159237dee4c343a9fb24b1c82e68 (diff) | |
download | scala-3f3014cf0edd8ea182d234d5987838223231d9c9.tar.gz scala-3f3014cf0edd8ea182d234d5987838223231d9c9.tar.bz2 scala-3f3014cf0edd8ea182d234d5987838223231d9c9.zip |
temporarily disables the toStringSubjects cache
-rw-r--r-- | src/reflect/scala/reflect/internal/tpe/TypeToStrings.scala | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/reflect/scala/reflect/internal/tpe/TypeToStrings.scala b/src/reflect/scala/reflect/internal/tpe/TypeToStrings.scala index ceb667365e..a062fc8209 100644 --- a/src/reflect/scala/reflect/internal/tpe/TypeToStrings.scala +++ b/src/reflect/scala/reflect/internal/tpe/TypeToStrings.scala @@ -20,11 +20,12 @@ private[internal] trait TypeToStrings { def toStringSubjects = _toStringSubjects protected def typeToString(tpe: Type): String = - if (toStringSubjects contains tpe) { - // handles self-referential anonymous classes and who knows what else - "..." - } - else if (toStringRecursions >= maxToStringRecursions) { + // if (toStringSubjects contains tpe) { + // // handles self-referential anonymous classes and who knows what else + // "..." + // } + // else + if (toStringRecursions >= maxToStringRecursions) { devWarning("Exceeded recursion depth attempting to print " + util.shortClassOfInstance(tpe)) if (settings.debug) (new Throwable).printStackTrace @@ -34,10 +35,14 @@ private[internal] trait TypeToStrings { else try { toStringRecursions += 1 - toStringSubjects += tpe + // TODO: study performance impact of this cache + // to quote Jason: + // I'm a little uneasy with the performance impact of the fail-safe. We end up calling Type#toString + // when we generate error messages, including, importantly, errors issued during silent mode that are never issued. + // toStringSubjects += tpe tpe.safeToString } finally { - toStringSubjects -= tpe + // toStringSubjects -= tpe toStringRecursions -= 1 } } |