But after updating to Xcode 10.2 today, which includes the Swift 5.0 release, all `children` members are of type `Syntax` and casting to `EnumCaseDeclSyntax` fails, although that's the type I'm expecting here. You can find an example Swift file being parsed here.
Why was this API changed to be less informative? And how am I supposed to cast it to the appropriate type going forward with the 5.0 release?
It would be great to get feedback soon, so I can make a Xcode 10.2 compatible release of my tool BartyCrouch. See also the appropriate line here.
Thank you for your help in advance!
The text was updated successfully, but these errors were encountered:
Please note that I found a way around this change, so it's not a pressing issue for me, but I would still expect something like the above being possible. Alternatively better documentation with more example uses would be great that covers stuff like this. Currently the project isn't particularly easy to use. But I'm sure you're aware of that.
@Jeehut We have this change because the items in a MemberDeclList consist not decls but another layer of structure called MemberDeclListItem . We need to unwrap MemberDeclListItem to get all the enum cases back.
More specifically, this is the code snippet you could use to replace the 4.2 version:
Thank you for the answer. I still think better documentation would be great for SwiftFormat with examples that are updated on new versions (instead of just linking to some examples usages that become out of date the moment a new version is released, like now).