Commit abe1314
committed
Fix #9492: Avoid forcing nested annotation
Java allows annotations inside arrays inside annotations, when parsing
the outer annotation, we need to produce an untyped tree for the array
and therefore the nested annotations. Previously this was done using
`Annotation#tree` which actually produces a typed tree, this works since
typed trees can be used as untyped tree but it requires forcing the
content of the nested annotation which can lead to cycles.
Instead, we now use a dedicated subclass of Annotation with an extra
`untpdTree` method we use for the purpose of generating a tree for the
nested annotation without forcing anything.1 parent dfcc0b1 commit abe1314
File tree
4 files changed
+32
-9
lines changed- compiler/src/dotty/tools/dotc/core
- classfile
- tests/pos-java-interop-separate/i9492
4 files changed
+32
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 166 | | |
173 | 167 | | |
174 | 168 | | |
| |||
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
558 | | - | |
| 558 | + | |
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
562 | 573 | | |
563 | 574 | | |
564 | 575 | | |
565 | | - | |
| 576 | + | |
566 | 577 | | |
567 | 578 | | |
568 | 579 | | |
| |||
584 | 595 | | |
585 | 596 | | |
586 | 597 | | |
587 | | - | |
| 598 | + | |
588 | 599 | | |
589 | 600 | | |
590 | 601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments