Files
swift-mirror/test/SourceKit/CursorInfo/rdar129417672.swift
Hamish Knight 5ec4d1cc98 [CS] Fill in ErrorTypes for expressions that fail to type-check
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
2024-06-17 17:58:52 +01:00

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 {
}
}
}
}
}