Raw text Strings and multiple quotes

print(#"""#)

This doesn't work.... I realize the 3 double quotes is a multiline indicator, and the is the error I get as well. But shouldn't this behaviour be overridden by the enclosing #

I am writing a Transpiler in Swift, and it needs to be able to analyze and emit a valid Swift code line that would resolve to multiple quotes. All other string situations are handled properly

Escaping with \ is unfortuantly not an option for reasons too complex to go into here and now

This was the bug SR-10011, and it's been fixed by @maustinstar. Try the latest Xcode beta or Swift development snapshots.

2 Likes

Thanks... this is my first time here.... appreciate the response

1 Like

No to be pushy or annoying... but if I read that correctly, this bug was resolved in Oct2020?
Almost 6 months ago now. How does one determine if (and which) version of Xcode/Swift it will appear in? The release notes for Xcode 12.5 don't seem to mention it, and I am currently using Swift 5.3.2 with Catalina

It will be in Swift 5.4.

Viewing the merged commit and clicking the ... under the commit message (near the top of the page) shows you the full list of tags that contain the commit. At the end of the list are a number of development snapshots of Swift 5.4. Xcode 12.5 will ship with Swift 5.4.

Swift 5.3 was released in September. I can only assume that the impact/risk of this change did not meet the criteria for inclusion in a subsequent point release, and/or nobody made a pull request to propose its inclusion in such a release. 5.3.1 and 5.3.2 were released in November and December, respectively.

Note that Swift 5.3 branched from master on April 20, 2020, so any fixes after that date (well before September) are included in Swift 5.3.x only if specifically nominated and reviewed for risk.

1 Like

Just to be clear... unlike (I assume) many of you. the only version of Xcode/Swift I will download is the version being offered by Apple via the App Store. I am not in a position to deal with anything else..

So I will wait until Swift 5.4 is the officially sanctioned version .

Thanks for your help.

Luckily this bug only affects an outlier situation in my Transpiler, so I can easily direct my testers to avoid it for now.

Terms of Service

Privacy Policy

Cookie Policy