Disallow multiline strings in `#sourceLocation` filename
Closed this issue · 3 comments
kimdv commented
Issue Kind
Bad Diagnostic Produced
Source Code
#sourceLocation(file: """
test.swift
other.swift
""", line: 10)
Is accepted and shouldn't be allowed
Description
No response
ahoppen commented
The same applies to almost all other syntax nodes that contain a StringLiteralExprSyntax
.
AttributeSyntax.arguments
(used for@_cdecl
and@_semantics
)AvailabilityLabeledArgumentSyntax.value
ConventionAttributeArgumentsSyntax.cTypeString
DocumentationAttributeArgumentSyntax.value
ExposeAttributeArgumentsSyntax.cxxName
OpaqueReturnTypeOfAttributeArgumentsSyntax.mangledName
OriginallyDefinedInAttributeArgumentsSyntax.moduleName
PoundSourceLocationArgumentsSyntax.fileName
UnavailableFromAsyncAttributeArgumentsSyntax.message
UnderscorePrivateAttributeArgumentsSyntax.filename
ahoppen commented
Tracked in Apple’s issue tracker as rdar://113567646
ahoppen commented
Decided that we should allow multi-line string literals here. See swiftlang/swift#71366