"Expression was too complex to be solved ..." error for relatively simple additive expressions

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:

The `thisIsBuggy()` function uses relatively simple additive expressions and fails to compile with "expression was too complex ..." error:

Simply extracting `x` and `y` parameters of CGPoint into separate variables solves the problem (see `thisIsTheFix ()` method).

Seems to be a known issue:

... 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.


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.

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!