Commit 85cd1cf
committed
New scheme for handling defaults of Java annotations
Previously, we made up default getters that were then recognized by the
backend, this has at least two downsides:
- Creating the default getters requires forcing the info of all the
methods in the annotation class, this might lead to cycles.
- This scheme leaks into Tasty, and therefore becomes part of the Tasty
specification, this is inelegant at best.
In the new scheme, no default getters are created, instead we
special-case the typing of annotation constructors: when an argument for
the annotation constructor is missing, we replace it with a typed
wildcard Ident if the corresponding parameter is known to have a default
value. The Tasty spec and the backend need to be aware of this usage of
wildcard, but that's easier to specify and to implement than default
getters.1 parent 4ab86db commit 85cd1cf
File tree
4 files changed
+44
-49
lines changed- compiler/src/dotty/tools
- backend/jvm
- dotc
- core/classfile
- parsing
- typer
4 files changed
+44
-49
lines changedLines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
258 | 260 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
268 | 267 | | |
269 | 268 | | |
270 | 269 | | |
| |||
Lines changed: 1 addition & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
638 | | - | |
639 | | - | |
640 | | - | |
| 638 | + | |
641 | 639 | | |
642 | | - | |
643 | | - | |
644 | 640 | | |
645 | 641 | | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | 642 | | |
654 | 643 | | |
655 | 644 | | |
| |||
662 | 651 | | |
663 | 652 | | |
664 | 653 | | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | 654 | | |
671 | 655 | | |
672 | 656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
| 130 | + | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
| 771 | + | |
782 | 772 | | |
783 | 773 | | |
784 | 774 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
555 | 576 | | |
556 | | - | |
| 577 | + | |
| 578 | + | |
557 | 579 | | |
558 | 580 | | |
559 | 581 | | |
| |||
0 commit comments