Commit 0555491
authored
Macro annotations class modifications (part 2) (#16454)
Enable modification of classes with `MacroAnnotation`:
* Can annotate `class` to transform it
* Can annotate `object` to transform the companion class
Supported class modifications:
* Modify the implementations of `def`, `val`, `var`, `lazy val`,
`class`, `object` in the class
* Add new `def`, `val`, `var`, `lazy val`, `class`, `object` members to
the class
* Add a new override for a `def`, `val`, `var`, `lazy val` members in
the class
Restrictions:
* An annotation on a top-level class cannot return a top-level `def`,
`val`, `var`, `lazy val`.
Related PRs:
* Includes #16513
* Follows #16392
* Followed by #16534File tree
58 files changed
+1143
-195
lines changed- compiler/src
- dotty/tools/dotc
- core
- transform
- scala/quoted/runtime/impl
- library/src/scala
- annotation
- quoted
- tests
- neg-macros
- annot-accessIndirect
- annot-error-annot
- annot-mod-class-add-top-method
- annot-mod-class-add-top-val
- annot-on-class
- annot-on-object
- annot-result-owner
- run-custom-args/tasty-inspector
- run-macros
- annot-bind
- annot-generate
- annot-memo
- annot-mod-class-add-def
- annot-mod-class-add-inner-class
- annot-mod-class-add-lazy-val
- annot-mod-class-add-local-class
- annot-mod-class-add-val
- annot-mod-class-add-var
- annot-mod-class-data
- annot-mod-class-equals
- annot-mod-class-mod-def
- annot-mod-class-mod-val
- annot-mod-class-override-def
- annot-mod-class-override-val
- annot-mod-class-unused-new-sym
- annot-result-order
- annot-simple-fib
- i11685
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
58 files changed
+1143
-195
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
| |||
Lines changed: 7 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 36 | + | |
| 37 | + | |
39 | 38 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 39 | + | |
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
| |||
126 | 122 | | |
127 | 123 | | |
128 | 124 | | |
129 | | - | |
| 125 | + | |
130 | 126 | | |
131 | | - | |
| 127 | + | |
132 | 128 | | |
133 | 129 | | |
| 130 | + | |
| 131 | + | |
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2485 | 2485 | | |
2486 | 2486 | | |
2487 | 2487 | | |
2488 | | - | |
2489 | | - | |
2490 | | - | |
2491 | 2488 | | |
2492 | 2489 | | |
2493 | | - | |
2494 | | - | |
2495 | | - | |
2496 | 2490 | | |
2497 | 2491 | | |
2498 | 2492 | | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
2499 | 2496 | | |
2500 | 2497 | | |
2501 | 2498 | | |
| |||
2519 | 2516 | | |
2520 | 2517 | | |
2521 | 2518 | | |
| 2519 | + | |
| 2520 | + | |
2522 | 2521 | | |
2523 | 2522 | | |
2524 | 2523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | | - | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | | - | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
75 | 185 | | |
76 | 186 | | |
77 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3669 | 3669 | | |
3670 | 3670 | | |
3671 | 3671 | | |
3672 | | - | |
3673 | | - | |
3674 | | - | |
3675 | | - | |
3676 | | - | |
3677 | | - | |
3678 | | - | |
3679 | | - | |
3680 | | - | |
3681 | | - | |
3682 | | - | |
3683 | | - | |
3684 | | - | |
3685 | | - | |
3686 | | - | |
3687 | | - | |
3688 | | - | |
3689 | | - | |
3690 | | - | |
3691 | 3672 | | |
3692 | 3673 | | |
3693 | 3674 | | |
| |||
3706 | 3687 | | |
3707 | 3688 | | |
3708 | 3689 | | |
3709 | | - | |
3710 | | - | |
3711 | | - | |
3712 | | - | |
3713 | | - | |
3714 | | - | |
3715 | | - | |
3716 | | - | |
3717 | | - | |
3718 | | - | |
3719 | | - | |
3720 | | - | |
3721 | | - | |
3722 | | - | |
3723 | | - | |
3724 | | - | |
3725 | | - | |
3726 | | - | |
3727 | | - | |
3728 | 3690 | | |
3729 | 3691 | | |
3730 | 3692 | | |
| |||
3742 | 3704 | | |
3743 | 3705 | | |
3744 | 3706 | | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
3745 | 3719 | | |
3746 | 3720 | | |
3747 | 3721 | | |
| |||
3772 | 3746 | | |
3773 | 3747 | | |
3774 | 3748 | | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
3775 | 3753 | | |
3776 | 3754 | | |
3777 | 3755 | | |
| |||
4411 | 4389 | | |
4412 | 4390 | | |
4413 | 4391 | | |
| 4392 | + | |
4414 | 4393 | | |
4415 | 4394 | | |
4416 | 4395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
0 commit comments