Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

swift compiler crash

I am trying to override a property getter and setter of a UIButton subclass. Swift compiler crashes all the time. If I commented the getter and setter out, it can be compiled successfully.


Part of crash messages:


0 swift 0x0000000102ed3428 llvm::sys::PrintStackTrace(__sFILE*) + 40

1 swift 0x0000000102ed3914 SignalHandler(int) + 452

2 libsystem_platform.dylib 0x00007fff832c7f1a _sigtramp + 26

3 libsystem_platform.dylib 0x000000010446da00 _sigtramp + 2165988096

4 swift 0x0000000102300faf swift::SILVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::ValueBase*) + 35631

5 swift 0x00000001022f7c4b swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 10267

6 swift 0x0000000102271688 swift::irgen::IRGenModule::emitGlobalTopLevel() + 200

7 swift 0x00000001022e488c performIRGeneration(swift::IRGenOptions&, swift::Module*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 1900

8 swift 0x00000001022e5283 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 51

9 swift 0x000000010224994c frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 5308

10 swift 0x0000000102246d4d main + 1677

11 libdyld.dylib 0x00007fff8587c5c9 start + 1


The problematic code:



class SSRecordButton: UIButton {

var recording:Bool = false

let circleWidth:CGFloat = 2.0

var timer:NSTimer?

overridevar highlighted: Bool = false {

didSet {

if (highlighted) {

println("highlighted")

} else {

println("not highlighted")

}

}

}

}


I am using XCode 6 GM and OSX10.10 DP7. XCode6 GM should be pretty stable, but this issue happen in both XCode6 DP6 and also GM build. Any other people have similar issue? I already fired a bug report to Apple.

Posted on Sep 10, 2014 12:33 AM

Reply
Question marked as Best reply

Posted on Sep 10, 2014 8:26 AM

I have heard that the swift compiler is still pretty buggy. Don't be too surprised at this.

2 replies

swift compiler crash

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.