diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-10-06 17:27:51 +1100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2016-10-07 14:27:54 +1100 |
commit | ef14a9af16d988e6240c8a3943fa3df84ee42606 (patch) | |
tree | 6726a261e6e8a1ab2d9cee7b9053d915b0aa9908 /src/reflect/scala/reflect/internal/TypeDebugging.scala | |
parent | 55c0581b476381fe66ff0df2ada44560f6511648 (diff) | |
download | scala-ef14a9af16d988e6240c8a3943fa3df84ee42606.tar.gz scala-ef14a9af16d988e6240c8a3943fa3df84ee42606.tar.bz2 scala-ef14a9af16d988e6240c8a3943fa3df84ee42606.zip |
SI-9946 don't null field in lazy accessors that turn out to be live
If a non-transient lazy val is the only user of a private field in
a class, the field is nulled out at the end of the lazy initializer.
This is tested in the existing test `run/lazy-leaks.scala`.
The analysis of which fields could be nulled out was recently moved
from `mixin` to the new `fields` phase. This introduced a regression
as a reference from an inner- or companion-classes had not yet
been processed by `explicitouter` to publicise private fields.
This commit delays the analysis to mixin (after explicit outer has
done its work.)
Navigating from `foo$lzycompute()` to `foo()` to `foo` is a little
dirty now. I'm not sure whether there is a more robust way to
structure things.
Diffstat (limited to 'src/reflect/scala/reflect/internal/TypeDebugging.scala')
-rw-r--r-- | src/reflect/scala/reflect/internal/TypeDebugging.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/TypeDebugging.scala b/src/reflect/scala/reflect/internal/TypeDebugging.scala index 63f897cd32..e9050b4e33 100644 --- a/src/reflect/scala/reflect/internal/TypeDebugging.scala +++ b/src/reflect/scala/reflect/internal/TypeDebugging.scala @@ -110,7 +110,7 @@ trait TypeDebugging { val hi_s = if (noPrint(hi)) "" else " <: " + ptTree(hi) lo_s + hi_s case _ if (t.symbol eq null) || (t.symbol eq NoSymbol) => to_s(t) - case _ => "" + t.symbol.tpe + case _ => "" + t.symbol.rawInfo.safeToString } def ptTypeParam(td: TypeDef): String = { val TypeDef(_, name, tparams, rhs) = td |