[swift-evolution] Pitch: Deprecate/remove AnyObject method dispatch
Johannes Weiß
johannesweiss at apple.com
Wed Oct 25 02:41:31 CDT 2017
yes, please. Especially having quite a long time (4.1 until 5.0) where this works but issues a warning sounds like a great transition plan.
> On 24 Oct 2017, at 11:02 pm, Slava Pestov via swift-evolution <swift-evolution at swift.org> wrote:
>
> Hi all,
>
> Dynamic dispatch of methods through AnyObject is a source of implementation complexity, has many known bugs which we are not going to fix, and no longer makes sense now in an id-as-Any world; AnyObject is not the ‘common currency’ type for arbitrary Objective-C objects anymore.
>
> I would like to propose we deprecate it as follows:
>
> - Unconditional warning in Swift 4.1, with a fixit to add an ‘as’ cast to cast the base value to the right type
> - Error in Swift 5 in -swift-version 5 mode
>
> Thoughts? Does anyone actually rely on this feature, instead of just stumbling on it by accident once in a while?
>
> Slava
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
More information about the swift-evolution
mailing list