Skip to content

Conversation

@rintaro
Copy link
Member

@rintaro rintaro commented Dec 11, 2025

Fixes #85958
swift-syntax PR is incoming

There's no reason to reject these string literals in #sourceLocation or @available(..., message:, renamed:) etc. We just want to reject string interpolation.

Also previously escaped strings are literally used i.e.

#sourceLocation(file: "foo\\bar", line: 1)
print(#file)

printed foo\\bar instead of foo\bar which was wrong. Correctly unescape the literal as regular string literals.

There's no reason to reject these string literals in `#sourceLocation`
or `@available(..., message:, renamed:)` etc. We just want to reject
string interpolation.

Also previously escaped strings are literally used i.e.
```swift
print(#file)
```
printed `foo\\bar` instead of `foo\bar` which is wrong. Correctly
unescape the literal as regular string literals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

filePathMode: .filePath breaks macro expansion on Windows

1 participant