Commit f4c8aab
committed
Don't assume final member class in another comp. unit will stay final
The optimization in scala#5099 that avoided needless capture of the enclosing
class, and hence improved serializability of local classes and functions,
went too far. It also caused constructor calls of member classes to
use `null` rather than the actual outer reference as the `$outer`
constructor argument. The enclosed test case exhibits this problem
by witnessing an null `Outer.this`.
This commit limits the strategy to use `null`-s to the outer refererences
of anonymous and local classes, which rules out cross compilation unit
effects (in absence of `-opt`.)1 parent 8721ec3 commit f4c8aab
File tree
3 files changed
+18
-1
lines changed- src/compiler/scala/tools/nsc/transform
- test/files/run/t10423
3 files changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
767 | | - | |
| 767 | + | |
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments