Commit 7e4acfa
committed
[Macros] Put the insertion location for freestanding macros at the beginning
When building the ASTScope tree, we set the insertion location for the
macro expansion just before the end of the macro use. This is the right
approach for attached macros, because we need to put the entities
after the macro.
However, for freestanding macros, which can have trailing closures,
this location is a problem, because the scope for the macro
expansion ends up inside the scope for the trailing closure. Use the
start location of the freestanding macro instead.
Fixes rdar://130923190.1 parent 39f826c commit 7e4acfa
File tree
3 files changed
+29
-1
lines changed- lib/AST
- test/Macros
- Inputs
3 files changed
+29
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
294 | 298 | | |
295 | 299 | | |
296 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
108 | 122 | | |
109 | 123 | | |
110 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
311 | 321 | | |
312 | 322 | | |
313 | 323 | | |
| |||
0 commit comments