Skip to content

[SR-10011] Raw string with 1 double quote give compiler error about multi line strings #52414

Closed
@swift-ci

Description

@swift-ci
Previous ID SR-10011
Radar None
Original Reporter MrLotU (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Swift 5.0 Snapshot from February 26, 2019

swift --version && uname -a output:

Apple Swift version 5.0-dev (LLVM 3207a50965, Clang 72dde1b133, Swift fa5d493110) Target: x86_64-apple-darwin18.2.0
Darwin LotU-MacBook-Pro.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64 

Platform: MacOS

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, Parser, StarterBug
Assignee maustinstar (JIRA)
Priority Medium

md5: 149b5f8191cb3508a0fd3fbf217154b8

Issue Description:

With the new raw strings in Swift 5, double quotes (") don't have to be escaped anymore (")

However, if I wanted a string containing just " an error will occur.
The code would look like this:

let str = #"""#

where I'd get the following compiler errors:

Multi-line string literal content must begin on a new line
// AND
Unterminated string literal

If you need any more info, feel free to ping me 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfgood first issueGood for newcomersparserArea → compiler: The legacy C++ parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions