"Expression was too complex to be solved ..." error for relatively simple additive expressions
Originator: | alex | ||
Number: | rdar://39206436 | Date Originated: | 5-Apr-2018 |
Status: | Open | Resolved: | |
Product: | Xcode | Product Version: | 9.3 (9E145) |
Classification: | Bug | Reproducible: | Always |
Refer the following gist for the sample: https://gist.github.com/alex-swiftify/76147f7386e9d693a82de4adf0feab58 The `thisIsBuggy()` function uses relatively simple additive expressions and fails to compile with "expression was too complex ..." error: http://take.ms/Ud4Wu Simply extracting `x` and `y` parameters of CGPoint into separate variables solves the problem (see `thisIsTheFix ()` method). Seems to be a known issue: https://stackoverflow.com/questions/29707622/swift-compiler-error-expression-too-complex-on-a-string-concatenation ... however, I'm reporting this specific case as suggested on Stack Overflow to help Apple Developers, since I'm reading the following: ``` On the Dev forums, Chris Lattner has asked people to file these errors as radar reports, because they are actively working on fixing them. ```
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!
Follow-up on the fixes
Many thanks for addressing this!
I confirm that a few (around 5-7) cases that I had with complex SwiftUI code or complex arithmetic expressions have been fixed. However, the following case still doesn't compile in Xcode 13 beta 2: https://gist.github.com/alex-swiftify/6166e0abda7472ebba35bbd05faab281
Let me know if you rather want a separate radar report for this case.