Mac OS X 10.10.2: Swift Compiler crash when emitting switch on @objc enum in another source file

Originator:jacob
Number:rdar://19775284 Date Originated:09-Feb-2015 07:18 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-Beta (6D520o)
Classification:Serious Bug Reproducible:Always
 
Summary:
Swift Compiler will crash when compiling a switch statement of an enum declared as @objc in a source file other than the one where switch statement is in.

Steps to Reproduce:
Build the included test project

Expected Results:
Compile!

Actual Results:
Segmentation fault 11.

Partial Trace:
CompileSwift normal x86_64 /Users/jacob/Programming/test/testSwift12/SwiftClass.swift

0  swift                    0x0000000109e4fd38 llvm::sys::PrintStackTrace(__sFILE*) + 40
1  swift                    0x0000000109e50214 SignalHandler(int) + 452
2  libsystem_platform.dylib 0x00007fff8ae0cf1a _sigtramp + 26
3  libsystem_platform.dylib 0x0000000000001400 _sigtramp + 1964983552
4  swift                    0x00000001097c766d (anonymous namespace)::NoPayloadEnumImplStrategyBase::emitValueSwitch(swift::irgen::IRGenFunction&, swift::irgen::Explosion&, llvm::ArrayRef<std::__1::pair<swift::EnumElementDecl*, llvm::BasicBlock*> >, llvm::BasicBlock*) const + 189
5  swift                    0x0000000109825bcb swift::SILVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::ValueBase*) + 22411
6  swift                    0x000000010981f83d swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 9485
7  swift                    0x000000010978c4ab swift::irgen::IRGenModule::emitGlobalTopLevel() + 155
8  swift                    0x000000010980a169 performIRGeneration(swift::IRGenOptions&, swift::Module*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 2121
9  swift                    0x000000010980ab63 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 51
10 swift                    0x0000000109748964 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 10196
11 swift                    0x0000000109745fe6 main + 1814
12 libdyld.dylib            0x00007fff92bd55c9 start + 1

1.	While emitting IR SIL function @_TFC11testSwift1210SwiftClass11isSomethingfS0_FOS_8TestEnumSb for 'isSomething' at /Users/jacob/Programming/test/testSwift12/SwiftClass.swift:12:5

Comments


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!