Commit bab2edc
committed
Fix safe-init error in TreePickler
When bootstrapping the compiler with the `-Ysafe-init` flag, we would get the following error:
```
[error] -- Error: /*************/dotty/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala:24:20
[error] 24 | pickler.newSection(ASTsSection, buf)
[error] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] |Call method TreePickler.this.pickler.newSection("ASTs",
[error] | dotty.tools.dotc.core.tasty.TreePickler.this.buf
[error] |) on a value with an unknown initialization. Calling trace:
[error] | -> val treePkl: TreePickler = new TreePickler(this) [ TastyPickler.scala:85 ]
[error] | -> class TreePickler(pickler: TastyPickler) { [ TreePickler.scala:22 ]
```
This supresses the warning for this case.
Review by @liufengyun1 parent 20842cf commit bab2edc
File tree
3 files changed
+3
-5
lines changed- compiler/src/dotty/tools/dotc
- core/tasty
- quoted
- transform
3 files changed
+3
-5
lines changedLines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | 84 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
0 commit comments