Swift 1.2b1: Compiler crash while type-checking return of boxed value with undeclared box type

Originator:rix.rob
Number:rdar://19916321 Date Originated:22-Feb-2015 10:25 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-Beta (6D520o)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
I think this might be related to some issues I’ve been seeing where SourceKitService crashes hard any time I look at the Either.swift file in my project. Box is being imported from a separate module but SourceKitService may not know that, and thus it implodes.


Steps to Reproduce:
1. Try to compile this:

enum E {
	case C(Box<Int>)

	var c: Box<Int>? {
		switch self {
		case let C(c): return c
		}
	}
}


Expected Results:
I expected it to error on the use of undeclared type 'Box', but not to crash.


Actual Results:
It printed errors about the use of the undeclared type 'Box', and then it crashed.


Regression:
Using Array<Int> instead of Box<Int> does not crash. Providing a definition of Box does not crash.


Notes:
Encountered this while pursuing a workaround to rdar://19673469 — which may or may not be related.

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!