mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Ensure we always produce typed AST, even if we fail to apply a solution. This fixes a cursor info issue where we'd to type-check a closure twice due to it not having a type set. rdar://129417672
20 lines
621 B
Swift
20 lines
621 B
Swift
// RUN: %sourcekitd-test -req=cursor -pos=12:11 %s -- %s
|
|
|
|
private class MacroApplication<Context: MacroExpansionContext>: SyntaxRewriter {
|
|
|
|
override func visitAny(_ node: Syntax) -> Syntax? {
|
|
if var declSyntax = node.as(DeclSyntax.self),
|
|
let attributedNode = node.asProtocol(WithAttributesSyntax.self),
|
|
!attributedNode.attributes.isEmpty
|
|
{
|
|
for (attribute, spec) in attributesToRemove {
|
|
if let index = self.expandedAttributes.firstIndex(where: { expandedAttribute in
|
|
expandedAttribute.position == attribute.position
|
|
}) {
|
|
} else {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|