Michael Ilseman wrote:

> The biggest issue with the proposal as written is with importing a typedef
> as an enum. Enums do not allow us to control the underlying storage,
> and thus we would constantly be paying a bridging cost in its use.
> [...]
> The second issue concerns importing bridged typedefs, e.g. NSString.
> In that case, we want the underlying storage to be NSString,
> but present it as a String to the users.

Could you import __attribute__((swift_wrapper(enum)) constants as follows:

public enum HKQuantityTypeIdentifier : String {
    case bodyMassIndex
    case bodyFatPercentage
    case height
    case bodyMass
    case leanBodyMass

    private static let _bodyMassIndex:     NSString
    private static let _bodyFatPercentage: NSString
    private static let _height:            NSString
    private static let _bodyMass:          NSString
    private static let _leanBodyMass:      NSString
}

-- Ben


_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to