Since Xcode 7 and Swift 2.0, I get the error above, like in the screenshot shown here:
In my case I had a private struct Constants
declared in both class A
and extension A
.
Probably it should be giving an error but it didn't.
I fixed it by going to Xcode -> Preferences -> Locations -> Set Relative
option to Derived Data.
I have the same problem with all Xcode 6.3 projects, I open in Xcode 7.0. I created a new project, copied all my source files and resources and everything worked without this compiler error. I thought this has something to do with the project settings. I turned off the Swift compile Optimization to "none" and the Trap 6 was gone away. Perhaps there are other settings, which also generate trouble, but for me this it was.
This worked for me, so just give it a try. i got this error while converting the code from swift 3 to swift 4.
Simply, go to Project>Target>Build Setting and search 'Swift Compiler - Code Generation' and set Optimization level to 'No Optimazation[-Onone]'.
I managed to get my project to build by setting the optimisation level to 'None' under the 'Swift Compiler - Code Generation' menu in the target (not the project) settings. See the screenshot below...
This shouldn't be a permanent solution because it more than doubles the size of the ipa. It should be possible to switch optimisation back on when Xcode 7 comes out of beta.
Go to project Build settings -> Swift Compiler - code generation -> Optimization Level
-> For both Debug & Release select option "Fast,Single-File Optimaiztion[-O]