-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.swift macroFeature → declarations: Swift `macro` declarationsFeature → declarations: Swift `macro` declarations
Description
Description
The compiler is not pointing to the position of a diagnostic embedded in a string literal expression.
See https://forums.swift.org/t/macro-diagnostic-position-ignored/78640 for more details.
Reproduction
MacroPositionDiagnosticBug.zip

main.swift:3:7: warning: This warning should be anchored at the 3rd character (from macro 'test')
1 | import MacroPositionDiagnosticBug
2 |
3 | #test("hello")
| `- warning: This warning should be anchored at the 3rd character (from macro 'test')
4 |
Expected behavior
I expect the compiler (and Xcode) to point to the diagnostic's given position.
Environment
swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.5 clang-1700.0.13.3)
Target: arm64-apple-macosx15.0
Additional information
No response
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.swift macroFeature → declarations: Swift `macro` declarationsFeature → declarations: Swift `macro` declarations