-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit 51c7a41
committed
Macro annotations class modifications (part 2)
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`1 parent 07e395d commit 51c7a41
File tree
33 files changed
+556
-135
lines changed- compiler/src/dotty/tools/dotc/transform
- tests
- neg-macros
- annot-error-annot
- annot-mod-class-add-top-method
- annot-mod-class-add-top-val
- annot-on-class
- annot-on-object
- run-macros
- annot-mod-class-add-def
- annot-mod-class-add-lazy-val
- annot-mod-class-add-val
- annot-mod-class-add-var
- 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
33 files changed
+556
-135
lines changedLines changed: 8 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 | + | ||
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
| |||
29 | 30 |
| |
30 | 31 |
| |
31 | 32 |
| |
32 | - | ||
33 | - | ||
34 | - | ||
35 | - | ||
36 | - | ||
37 | - | ||
33 | + | ||
34 | + | ||
38 | 35 |
| |
39 | - | ||
36 | + | ||
40 | 37 |
| |
41 | 38 |
| |
42 | 39 |
| |
| |||
70 | 67 |
| |
71 | 68 |
| |
72 | 69 |
| |
73 | - | ||
74 | 70 |
| |
75 | 71 |
| |
76 | 72 |
| |
| |||
98 | 94 |
| |
99 | 95 |
| |
100 | 96 |
| |
101 | - | ||
97 | + | ||
102 | 98 |
| |
103 | - | ||
99 | + | ||
104 | 100 |
| |
105 | 101 |
| |
102 | + | ||
103 | + | ||
106 | 104 |
| |
107 | 105 |
| |
108 | 106 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | - | ||
3 | - | ||
4 | - | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
5 | 15 |
| |
6 | 16 |
| |
7 | - | ||
8 | - | ||
9 | - | ||
17 | + | ||
18 | + | ||
19 | + | ||
10 | 20 |
| |
11 | 21 |
| |
12 | - | ||
13 | - | ||
14 | - | ||
22 | + | ||
23 | + | ||
24 | + | ||
15 | 25 |
| |
16 | 26 |
| |
17 | - | ||
18 | - | ||
19 | - | ||
27 | + | ||
28 | + | ||
29 | + | ||
20 | 30 |
| |
21 | 31 |
| |
22 | - | ||
23 | - | ||
24 | - | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
25 | 47 |
| |
26 | - | ||
27 | - | ||
28 | - | ||
29 | - | ||
30 | - | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
31 | 52 |
| |
32 | - | ||
33 | - | ||
34 | - | ||
35 | - | ||
36 | - | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
37 | 57 |
| |
38 | 58 |
| |
39 | - | ||
40 | - | ||
41 | - | ||
59 | + | ||
60 | + | ||
61 | + | ||
42 | 62 |
| |
43 | 63 |
| |
44 | - | ||
45 | - | ||
46 | - | ||
64 | + | ||
65 | + | ||
66 | + | ||
47 | 67 |
| |
48 | 68 |
| |
49 | - | ||
50 | - | ||
51 | - | ||
69 | + | ||
70 | + | ||
71 | + | ||
52 | 72 |
| |
53 | 73 |
| |
54 | - | ||
55 | - | ||
56 | - | ||
74 | + | ||
75 | + | ||
76 | + | ||
57 | 77 |
| |
58 | - | ||
59 | - | ||
60 | - | ||
61 | - | ||
62 | - | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | ||
82 | + | ||
63 | 83 |
| |
64 | - | ||
65 | - | ||
84 | + | ||
85 | + | ||
86 | + | ||
87 | + | ||
88 | + | ||
89 | + | ||
90 | + | ||
91 | + | ||
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | ||
66 | 96 |
| |
67 | 97 |
| |
68 | 98 |
| |
| |||
85 | 115 |
| |
86 | 116 |
| |
87 | 117 |
| |
88 | - | ||
118 | + | ||
89 | 119 |
| |
90 | - | ||
120 | + | ||
91 | 121 |
| |
92 | 122 |
| |
93 | 123 |
| |
94 | - | ||
124 | + | ||
95 | 125 |
| |
96 | - | ||
126 | + | ||
97 | 127 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 | - | ||
10 | + | ||
11 | 11 |
| |
12 | 12 |
| |
13 | - | ||
13 | + | ||
14 | 14 |
| |
15 | 15 |
| |
16 | + | ||
17 | + | ||
18 | + | ||
19 | + | ||
20 | + | ||
21 | + | ||
16 | 22 |
| |
17 | 23 |
| |
18 | 24 |
| |
| |||
23 | 29 |
| |
24 | 30 |
| |
25 | 31 |
| |
26 | - | ||
32 | + | ||
27 | 33 |
| |
28 | 34 |
| |
29 | - | ||
35 | + | ||
30 | 36 |
| |
31 | 37 |
| |
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
32 | 44 |
| |
33 | 45 |
| |
34 | 46 |
| |
| |||
39 | 51 |
| |
40 | 52 |
| |
41 | 53 |
| |
42 | - | ||
54 | + | ||
43 | 55 |
| |
44 | 56 |
| |
45 | - | ||
57 | + | ||
46 | 58 |
| |
59 | + | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
47 | 64 |
| |
48 | 65 |
| |
49 | 66 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + |
Lines changed: 18 additions & 0 deletions
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 | + | ||
16 | + | ||
17 | + | ||
18 | + |
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + |
Lines changed: 17 additions & 0 deletions
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 | + | ||
16 | + | ||
17 | + |
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + |
This file was deleted.
0 commit comments