Swift 2.0b4: swiftc infinite loop checking IR for generic enum with indirect & parameterized cases

Originator:rix.rob
Number:rdar://22169679 Date Originated:06-Aug-2015 09:25 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-beta (7A165t)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
`indirect case`s and direct `case`s holding type parameters cannot coexist in the same `enum`, apparently.


Steps to Reproduce:
This code:
enum E<T> {
	indirect case A(E)
	case B(T)
}


Expected Results:
should not cause swiftc to diverge and crash


Actual Results:
but totally does. It’s just looping through these two frames ad SIGSEGVum:
2   swift                         	0x0000000105123760 (anonymous namespace)::IsIRTypeDependent::visit(swift::CanType) + 896
3   swift                         	0x000000010512334b (anonymous namespace)::IsIRTypeDependent::visitEnumDecl(swift::EnumDecl*) + 155


Regression:
You can work around this by:

- Removing either `case`.
- Removing the type parameter.
- Not parameterizing `B` by the type parameter.
- Making `B` indirect.


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!