I filed a bug report based on my own situation. Hopefully more people will submit bug reports and Apple will coalesce them. Here's the info:
Bug ID: 21376523
Title: Adding property of type SCNVector3 yields "Abort trap: 6" error
Classification: Serious Bug
Reproducibility: Always
Description:
When using Swift 2 with Xcode 7 beta-1 (7A120f), with SceneKit, using SCNVector3 produces "Abort trap: 6" compile error. This happens whether a project is migrated from (Swift 1.2 + Xcode 6.3) to (Swift 2 + Xcode 7.0), or with a fresh Swift 2 + Xcode 7.0 project. Error text is below:
------------------
[COMMAND LINE COMPILER OPTIONS OMITTED BECAUSE OF 3,000 WORD BUG REPORT LIMIT]
Assertion failed: ((IGF.IGM.DataLayout.getTypeSizeInBits(coercionTy) == IGF.IGM.DataLayout.getTypeSizeInBits(paramTI.StorageType)) && "Coerced types should not differ in size!"), function emitDirectExternalParameter, file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-700.0.38.1/src/swift/lib/IRGen/IRGenSIL.cpp, line 908.
0 swift 0x000000010c9cae0b llvm::sys::PrintStackTrace(__sFILE*) + 43
1 swift 0x000000010c9cb54b SignalHandler(int) + 379
2 libsystem_platform.dylib 0x00007fff9030cf1a _sigtramp + 26
3 libsystem_platform.dylib 0x0000000000000007 _sigtramp + 1875849479
4 libsystem_c.dylib 0x00007fff900cab53 abort + 129
5 libsystem_c.dylib 0x00007fff90092c39 basename + 0
6 swift 0x000000010ab1269d (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 13693
7 swift 0x000000010ab0ed52 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 498
8 swift 0x000000010aa5f46c swift::irgen::IRGenModuleDispatcher::emitGlobalTopLevel() + 412
9 swift 0x000000010aaf5515 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 821
10 swift 0x000000010aaf5926 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 70
11 swift 0x000000010a9e505f performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&) + 11663
12 swift 0x000000010a9e20b3 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2515
13 swift 0x000000010a9de28f main + 1983
14 libdyld.dylib 0x00007fff92d4d5c9 start + 1
Stack dump:
[0. PROGRAM ARGUMENTS OMITTED BECAUSE OF 3,000 WORD BUG REPORT LIMIT]
1. While emitting IR SIL function @_TToFC18AbortTrapTestSwift18GameViewControllers1pVSC10SCNVector3 for 'p' at /Users/bstahl/Library/Mobile Documents/com~apple~CloudDocs/Developer/Code/AbortTrapTestSwift/AbortTrapTestSwift/GameViewController.swift:14:6
Steps to reproduce:
Setup: Install Xcode 7.0 (7A120f). Check for current SDKs and documentation in Preferences and install.
1. Create a brand-new project in Xcode 7 beta-1. Type is "Game", Language is "Swift", Game Technology is "SceneKit".
2. Build and run with default settings. Project builds and runs fine in simulator (you will see the default rotating 3D spaceship model).
3. Add a single SCNVector3 property to the gamecontroller in GameViewController.swift, like this:
class GameViewController: UIViewController {
var p = SCNVector3Zero
--> Produces "Abort trap: 6". Project will no longer compile.
4. Change the constant to an empty initializer.
class GameViewController: UIViewController {
var p = SCNVector3()
--> Same problem, "Abort trap: 6"
5. Remove property, restoring to the clean project state. "Abort trap: 6" is gone, project again compiles and runs.
6. Change "var" to "let".
class GameViewController: UIViewController {
let p = SCNVector4Zero
-- > Compiles and runs.
7. Change property type to SCNVector4 instead of SCNVector3.
class GameViewController: UIViewController {
var p = SCNVector4Zero
-- > Compiles and runs.
Expected results: Project should compile and run. Before adding SCNVector3 property, project already runs, therefore it should already be using SceneKit and its associated type.
Actual results: Project will not compile and exits with "Abort trap: 6" error. There are no suggestions for fixing the problem.
Additional information:
Bug DOES NOT occur if:
- property "var" is changed to "let".
- property type is changed from SCNVector3 type to SCNVector4 type ("var" or "let").
- property declaration is removed from project.
- project is created and compiled under Swift 1.2 in Xcode 6.3.X
Bug STILL occurs if:
- property uses an initializer instead of SCNVector3Zero ("var p = SCNVector3()").