Skip to content

[SR-9016] Multiline string literals not quite working in directives #51519

@dabrahams

Description

@dabrahams
Previous ID SR-9016
Radar None
Original Reporter @dabrahams
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: bba9dee0eadbdfddf6981636ca1786ee

Issue Description:

Run this:

@available(*, deprecated, message:
    """
    This is a message \
    that has only one line \
    written on multiple lines
    """)
var x = 3
var y = x

print(
    """
    This is a message \
    that has only one line \
    written on multiple lines
    """)

Note how the output of the print differs from that of the warning:

x.swift:8:9: warning: 'x' is deprecated: 
    This is a message     that has only one line     written on multiple lines
    
var y = x
        ^
This is a message that has only one line written on multiple lines

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions