File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
test/SourceKit/CodeExpand
tools/SourceKit/lib/SwiftLang Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -273,3 +273,22 @@ expandClosureWithInternalParameterNames {
273
273
// CHECK: withtrail { a, b in
274
274
// CHECK-NEXT: <#code#>
275
275
}
276
+
277
+ func expandMacro( ) {
278
+ #foo( < #T##( ) - > Int#> )
279
+ // CHECK: #foo {
280
+ // CHECK-NEXT: <#code#>
281
+ // CHECK-NEXT: }
282
+
283
+ #foo( bar: < #T##( ) - > ( ) #> )
284
+ // CHECK: #foo {
285
+ // CHECK-NEXT: <#code#>
286
+ // CHECK-NEXT: }
287
+
288
+ #foo( bar: < #T##( ) - > Int#> , baz: < #T##( ) - > ( ) #> )
289
+ // CHECK: #foo {
290
+ // CHECK-NEXT: <#code#>
291
+ // CHECK-NEXT: } baz: {
292
+ // CHECK-NEXT: <#code#>
293
+ // CHECK-NEXT: }
294
+ }
Original file line number Diff line number Diff line change @@ -1690,6 +1690,9 @@ class PlaceholderExpansionScanner {
1690
1690
if (auto *CE = dyn_cast<CallExpr>(E)) {
1691
1691
// Call expression can have argument.
1692
1692
Args = CE->getArgs ();
1693
+ } else if (auto *ME = dyn_cast<MacroExpansionExpr>(E)) {
1694
+ // Macros can have arguments.
1695
+ Args = ME->getArgs ();
1693
1696
}
1694
1697
if (!Args)
1695
1698
return false ;
You can’t perform that action at this time.
0 commit comments