Objective-C enum is not working anymore in Swift

Originator:kevin
Number:rdar://23461790 Date Originated:09-Nov-2015 01:02 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 7.1
Classification:Serious bug Reproducible:Always
 
Summary:
Using an Objective-C enum (backed by `NSUInteger`) in Swift is not working. Xcode shows any swift property of the type of this enum as it has no values defined (= a case of the enum) . See image attachments and test project that you can run.

Code is the following:

In Objective-C — State.h
```objc
#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, State) {
	StateDraft,
	StateSent,
	StateInvalid,
	StateWaitingForUpload,
};
```

In the Bridging Header file:
```objc
#import "State.h"
```

In Swift:
```swift
let state = State.Sent
_ = state // breakpoint here: po state gives an error (error: <EXPR>:1:1: error: use of unresolved identifier 'state')
print(state)
```

Steps to Reproduce:
1. Install Xcode 7.1 (7B91b)
2. Create an enum in Objective-C (as in the project in attachment)
3. Add the enum file to the bridge file for using in Swift
4. Create a Swift file that declares and instantiate a property of the type of the enum created in step 2
5. Execute and check the value of this property

Expected Results:
The property should have the value of the enum that it's been given.

Actual Results:
The property has no value and is in an "undefined" state.

Version:
Xcode 7.1 (7B91b) - OS X El Capitan 10.11.1 (15B42)

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!