Uploaded image for project: 'Swift'
  1. Swift
  2. SR-10011

Raw string with 1 double quote give compiler error about multi line strings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler
    • Labels:
    • Environment:

      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

        Attachments

          Activity

            People

            Assignee:
            maustinstar Michael Verges
            Reporter:
            MrLotU Jari Koopman
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: