Swift 2b2: Crash with generic enum with two cases, one of which uses the type parameter and the other has empty tuple type
| Originator: | rix.rob | ||
| Number: | rdar://21515490 | Date Originated: | 23-Jun-2015 08:28 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode-beta (7A121l) |
| Classification: | Crash/Hang/Data Loss | Reproducible: | Always |
Summary:
Weird corner case where () after the case will crash.
Steps to Reproduce:
This code:
enum E<T> {
case A(T)
case B()
}
Expected Results:
should not crash the compiler
Actual Results:
but totally does:
Assertion failed: (elt == getPayloadElement() && "cannot project no-data case"), function projectDataForStore, file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-700.0.42.3/src/swift/lib/IRGen/GenEnum.cpp, line 1224.
0 swift 0x0000000103890b9b llvm::sys::PrintStackTrace(__sFILE*) + 43
1 swift 0x00000001038912db SignalHandler(int) + 379
2 libsystem_platform.dylib 0x00007fff8a9b5f1a _sigtramp + 26
3 libsystem_platform.dylib 0x0000000000000004 _sigtramp + 1969529092
4 libsystem_c.dylib 0x00007fff8cb9fb53 abort + 129
5 libsystem_c.dylib 0x00007fff8cb67c39 basename + 0
6 swift 0x000000010196e8f3 (anonymous namespace)::SinglePayloadEnumImplStrategy::projectDataForStore(swift::irgen::IRGenFunction&, swift::EnumElementDecl*, swift::irgen::Address) const + 131
…
15 swift 0x0000000101892a9f main + 1983
16 libdyld.dylib 0x00007fff8beea5c9 start + 1
Stack dump:
0. Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file boom.swift -target x86_64-apple-darwin14.3.0 -enable-objc-interop -module-name boom -o /var/folders/9y/f7n4rvx901nctm_5d16c1wm40000gn/T/boom-9c16d4.o
1. While emitting IR SIL function @_TFO4boom1E1BurfMGS0_q__FT_GS0_q__ for 'B' at boom.swift:3:7
<unknown>:0: error: unable to execute command: Abort trap: 6
<unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
Regression:
N/A
Notes:
N/A
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!