String expression can cause compiler error in Swift
| Originator: | weston | ||
| Number: | rdar://19264470 | Date Originated: | 12/16/2014 |
| Status: | Open | Resolved: | |
| Product: | Swift | Product Version: | |
| Classification: | Reproducible: | YES |
Summary:
When creating an expression that concatenates a string with inline variables in swift, the compiler will complain that the expression is too complex
error: expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions
Steps to Reproduce:
See attached playground, or use the following code.
let str1 = "Test1"
let str2 = "Test2"
let str3 = "Test3"
let str4 = "Test4"
let str5 = "Test5"
let str6 = "Test6"
var newStr = "\n Test: \(str1)" +
"\n Test: \(str2)" +
"\n Test: \(str3)" +
"\n Test: \(str4)" +
"\n Test: \(str5)" +
"\n Test: \(str6)"
Expected Results:
newStr should be created.
Actual Results:
compiler error
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!