[swift-evolution] Pitch: Omit deprecation warnings for same-file references

Víctor Pimentel Rodríguez vpimentel at tuenti.com
Wed May 10 04:34:56 CDT 2017


On Tue, May 9, 2017 at 12:34 AM, Tony Allevato via swift-evolution <
swift-evolution at swift.org> wrote:

> On Fri, May 5, 2017 at 4:00 PM Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
>
>> The reason I suggest this is that the most consistent boundary with the
>> rest of Swift is the module. I don't doubt that some may wish to deprecate
>> features even for some subset of internal users, but it seems plainly
>> obvious to me that the more common scenario will be deprecating for public
>> consumption only.
>>
>
> Normally I'd agree with this—I tend to think caring too much about access
> control beyond internal/external API boundaries is a bit too fine-grained.
> But...
>
> Since you're presenting scenarios in which it might make sense to have
>> scope-based or file-based deprecation, then more fine tuning would be the
>> answer. Without that, I'd argue the default ought to be what I call "public
>> deprecated." The within-a-module use case should be the later addition.
>>
>
> After seeing some of the considerations from other folks who replied in
> the thread, I've come around to your suggestion that more fine-tuning is
> the best approach moving forward.
>

I think that different needs for that warning suppression would arise
inside the community. Some folks may want deprecated things inside a module
to trigger warnings (for example in a monolithic app) while others may not.

The best option for me is stated in the "alternatives considered" section
of your proposal: just adding a "suppress warnings block" like most other
languages (Java, C/ObjC, even Swiftlint). That way everyone can apply to
their use cases as needed and scales to every case.

About the potential of abuse, in my recent experience with ObjC, we have a
policy of zero warnings and we hardly ever use those suppression warnings.
Of course, like with every other feature, it can be abused, but it's not
difficult to keep it controlled.

>From my point of view this will be the only way of having reasonable
defaults for not only this warning but for every other warning. Otherwise
we end up in a place where the rules for each warning are so intricate that
nobody understands them.

-- 

Víctor Pimentel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170510/083514dc/attachment.html>


More information about the swift-evolution mailing list