@@ -154,13 +154,37 @@ order of macros:
154
154
155
155
Here, the macros applied to C are run `first`, `second`, then `third`.
156
156
157
+ * **Macros are applied to superclasses, mixins, and interfaces first, in**
158
+ **Phase 2** For example:
159
+
160
+ ```dart
161
+ @third
162
+ class B extends A with C implements D {}
163
+
164
+ @second
165
+ class A implements C {}
166
+
167
+ @first
168
+ class C {}
169
+
170
+ @first
171
+ class D {}
172
+ ```
173
+
174
+ Here, the macros on `A`, `C` and `D` run before the macros on `B`, and `C`
175
+ also runs before `A`. But otherwise the ordering is not defined (it is not
176
+ observable).
177
+
178
+ This only applies to Phase 2, because it is the only phase where the order
179
+ would be observable. In particular this allows macros running on `B` to see
180
+ any members added to its super classes, mixins, or interfaces, by other
181
+ macros running in phase 2.
182
+
157
183
Aside from these rules, macro introspection is limited so that evaluation order
158
184
is not user visible. For example, if two macros are applied to two methods in
159
185
the same class, there is no way for those macros to interfere with each other
160
186
such that the application order can be detected.
161
187
162
- **TODO*: Are superclass macros run before subclasses (#1938)?
163
-
164
188
## Phases
165
189
166
190
Before we can get into how macro authors create macros, there is another
0 commit comments