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 /test/files/run/t9946a.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 'test/files/run/t9946a.scala')
0 files changed, 0 insertions, 0 deletions