SwiftScripting
SwiftScripting copied to clipboard
Incorrect Generation of Enum Cases
Using the latest version to make Swift files for the Finder's sdef, this is part of the output:

In C, enum items do not need unique values. In Swift, they do. It's my understanding that the correct way to handle this situation would be to generate:
@objc public enum FinderEcvw : AEKeyword {
case iconView = 0x69636e76 /* 'icnv' */
case listView = 0x6c737677 /* 'lsvw' */
case columnView = 0x636c7677 /* 'clvw' */
case groupView = 0x666c7677 /* 'flvw' */
static var flowView: FinderEcvw { return groupView }
}
I've "handled" these collisions in the past by making a hand-edit to comment out the duplicate case. Your suggested approach is interesting. I'll consider beefing up the conversion logic if/when I spend time on updating the conversion script.
Thank you.