However, in the Swift 3.0 compiler that's included in Xcode 8 beta 4, line 11 produces the following error:
complex-expression.swift:11:13: error: expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions
let foo = Foo(elements: (0 ... 2 * c + 1).map { ($0 & ~1, String($0)) })
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Extracting the upper bound of the closed range expression into a separate variable works around the issue.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Environment
Apple Swift version 3.0 (swiftlang-800.0.41.2 clang-800.0.36)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: cab3005164fef8464fdf85648ba7fdfa
Issue Description:
The code below (also attached) compiles without errors under Swift 2.x and Swift 3.0 betas before the latest, beta 4:
However, in the Swift 3.0 compiler that's included in Xcode 8 beta 4, line 11 produces the following error:
Extracting the upper bound of the closed range expression into a separate variable works around the issue.
The text was updated successfully, but these errors were encountered: