mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Handle CustomAttrs arguments for placeholder expansion
Introduce a new ASTWalker option for walking CustomAttrs and use it for the placeholder scanner to ensure we can expand placeholders in attribute arguments.
This commit is contained in:
@@ -315,3 +315,23 @@ struct ExpandDeclMacro {
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: }))
|
||||
}
|
||||
|
||||
@Foo(<#Int#>)
|
||||
func testDeclAttr1() {}
|
||||
// CHECK: @Foo(<#Int#>)
|
||||
// CHECK-NEXT: func testDeclAttr1() {}
|
||||
|
||||
@Foo(<#T##() -> ()#>)
|
||||
func testDeclAttr2() {}
|
||||
// CHECK: @Foo({
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: })
|
||||
// CHECK-NEXT: func testDeclAttr2() {}
|
||||
|
||||
func testTypeAttr1(x: @Foo(<#Int#>) String) {}
|
||||
// CHECK: func testTypeAttr1(x: @Foo(<#Int#>) String) {}
|
||||
|
||||
func testTypeAttr2(x: @Foo(<#T##() -> ()#>) Int) {}
|
||||
// CHECK: func testTypeAttr2(x: @Foo({
|
||||
// CHECK-NEXT: <#code#>
|
||||
// CHECK-NEXT: }) Int) {}
|
||||
|
||||
Reference in New Issue
Block a user