is there a way to deprecate a re-export? meaning something like (does not compile):
@available(*, deprecated)
@_exported import SoonToBecomeNonReexportedModule
is there a way to deprecate a re-export? meaning something like (does not compile):
@available(*, deprecated)
@_exported import SoonToBecomeNonReexportedModule
There isn't a way to accomplish this today but I chatted with some folks about it and we agreed it would be useful to be able to apply a limited version of availability annotations to import declarations in libraries. Seems like it could potentially be worth a pitch! I know that doesn't help you address any immediate goals, though.
If the availability only applied to the _exported part of the import then not sure why this would need an evolution cycle.
I think this deserves real discussion and design, though. Supporting it on just @_exported import
is a similar amount of implementation work and this is an idea I'd be hesitant to put a lot of effort into an implementation without some discussion indicating that the general idea is on the right track.
In my mind an availability annotation should apply to the entire import declaration. It would indicate to the compiler that use of any declarations that are only visible transitively through this import should trigger a diagnostic. That diagnostic could suggest that client code import the module or it could print an arbitrary message supplied by the library owner via message:
.