Declaring an enum within a class/struct extension crashes compiler

Originator:dwineman
Number:rdar://19795911 Date Originated:2015-02-11
Status:Closed Resolved:Fixed
Product:Developer Tools Product Version:Xcode 6.3 (6D520o)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
When the Swift 1.2 compiler encounters an enum declaration within a class or struct extension, and the class or struct being extended is from a system framework, it crashes with a segmentation fault.

Steps to Reproduce:
1. Create a new Swift project using any template (I used iOS / Single-View Application, no Core Data)
2. Set build target to iOS Device
3. Paste the following at the bottom of any source file (I chose AppDelegate.swift) and build:

extension CGRect {  // (or UIView, or NSManagedObjectContext, etc.)
  enum Bear {
    case Grizzly
    case Black
    case Polar
  }
}

Expected Results:
Project builds.

Actual Results:
Compiler segfaults (output attached).

Regression:
New in Xcode 6.3; this code builds fine on 6.1.1 and 6.2.

Notes:
Enums in extensions to my own classes/structs or those in the Swift Standard Library work fine.

Comments

Fixed in Xcode 6.3b4.

Attachment

Compiler output: https://www.dropbox.com/s/m8xdkj5401b0fav/crash.txt?dl=0


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!