apple / swift-argument-parser

Straightforward, type-safe argument parsing for Swift
Apache License 2.0
3.3k stars 311 forks source link

Remove `@_implementationOnly` annotations #616

Closed keith closed 6 months ago

keith commented 6 months ago

These annotations produce warnings when compiling swift-syntax without library evolution using Swift ≥5.10.

Replace them by private import when compiling using Swift ≥5.11.

Mirrors https://github.com/apple/swift-syntax/pull/2429

Checklist

keith commented 6 months ago

@swift-ci please test

keith commented 6 months ago

@swift-ci please test

keith commented 6 months ago

@natecook1000 can you review? (sorry I can't add you as a reviewer here)

rauhul commented 6 months ago

Is there a reason to use private instead of internal?

Additionally could we use an upcoming feature flag instead of conditional compilation?

keith commented 6 months ago

I don't have a pref on private vs internal for this case, was just trying to mirror similarly to what was here before. But I guess if private works I'd think we should prefer that, wdyt? Based on https://github.com/apple/swift-syntax/pull/2429#discussion_r1462534192 you cannot use that flag instead

rauhul commented 6 months ago

I wasn't sure if there was a specific reason to prefer private other than minimally scoped imports. Given the context of the swift-syntax comment, this changes lgtm, but I'll wait for Nate to do the final approval

keith commented 6 months ago

@swift-ci please test