Commit 40e437f
committed
TreeUnpickler: fix cycle involving param accessor
When unpickling a template like `A` in i12834.scala, the first thing we
do is to unpickle its class parameters, here that's `ref`. While
unpickling `ref` we run `avoidPrivateLeaks` on it which forces its info
and requires unpickling `B` which refers to `A.<init>` which leads to a
crash because we haven't entered `<init>` in `A` yet. We can avoid this
cycle by simply not running `avoidPrivateLeaks` on param accessors, this
should be safe since a primary constructor parameter cannot refer to a
type member of the class.
Fixes #12834.1 parent c45fce3 commit 40e437f
File tree
2 files changed
+8
-1
lines changed- compiler/src/dotty/tools/dotc/core/tasty
- tests/pos
2 files changed
+8
-1
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
884 | | - | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
885 | 890 | | |
886 | 891 | | |
887 | 892 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments