Skip to content

Commit 63633ce

Browse files
authored
clarify that macros can't generate macros (#2024)
1 parent 2100ca1 commit 63633ce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

working/macros/feature-specification.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ Here, macros contribute new types to the program—classes, typedefs, enums,
260260
etc. This is the only phase where a macro can introduce a new visible name into
261261
the top level scope.
262262

263+
**Note**: Macro classes _cannot_ be generated in this way, but they can rely on
264+
macro generated declarations for their implementation. This ensures that all
265+
macros can be discovered prior to actually running any macros.
266+
263267
Very little introspective power is provided in this phase. Since other macros
264268
may also be declaring new types, we can't even assume that all top-level
265269
identifiers can be resolved. You can see the *names* of types that are
@@ -317,6 +321,7 @@ See some example macros [here][examples].
317321
constructors are invoked, and their limitations.
318322
- All macros must implement at least one of the `Macro` interfaces.
319323
- Macros cannot be abstract.
324+
- Macro classes cannot be generated by other macros.
320325

321326
*Note: The Macro API is still being designed, and lives [here][api].*
322327

0 commit comments

Comments
 (0)