Skip to content

Commit 0de3232

Browse files
authored
Merge pull request swiftlang#70 from rxwei/freestanding-macro-revision
Ban macros generating default literal type overrides
2 parents 70956b7 + 4e242fc commit 0de3232

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

proposals/nnnn-freestanding-macros.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ A macro can expand to any declaration that is syntatically and semantically well
197197
* `extension` declarations can never be produced by a macro. The effect of an extension declaration is wide-ranging, with the ability to add conformances, members, and so on. These capabilities are meant to be introduced in a more fine-grained manner.
198198
* `operator` and `precedencegroup` declarations can never be produced by a macro, because they could allow one to reshape the precedence graph for existing code causing subtle differences in the semantics of code that sees the macro expansion vs. code that does not.
199199
* `macro` declarations can never be produced by a macro, because allowing this would allow a macro to trivially produce infinitely recursive macro expansion.
200+
* Top-level default literal type overrides, including `IntegerLiteralType`,
201+
`FloatLiteralType`, `BooleanLiteralType`,
202+
`ExtendedGraphemeClusterLiteralType`, `UnicodeScalarLiteralType`, and
203+
`StringLiteralType`, can never be produced by a macro.
200204

201205
### Up-front declarations of newly-introduced names
202206

0 commit comments

Comments
 (0)