Xcode fails to generate correct NSManagedObject subclasses with Integer, Double, Float properties in Swift

Number:rdar://21098433 Date Originated:25 May 2015
Status:Open Resolved:
Product:Xcode Product Version:6.3.2 (6D2105)
Classification:Serious bug Reproducible:Always
When generating a Swift NSManagedObject subclass with Integer, Double, or Float properties, Xcode generates properties of NSNumber.

Steps to Reproduce:
1. Create an entity in Core Data with Integer, Float, Double attributes
2. Generate NSManagedObject subclass
3. Note that all properties are NSNumber instances

Expected Results:
For an entity with a Int64, Float, and Double, Xcode should generate the following Swift class:

class TestEntity: NSManagedObject {

    @NSManaged var myInt: Int64
    @NSManaged var myDouble: Double
    @NSManaged var myFloat: Float


Actual Results:
Xcode generates the following instead:

class TestEntity: NSManagedObject {

    @NSManaged var myInt: NSNumber
    @NSManaged var myDouble: NSNumber
    @NSManaged var myFloat: NSNumber


6.3.2 (6D2105)





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!