> #begindeprecation(message=“optional comment”, available=iOS 8.0)
> func fetchProjects(query query : String?) {
>    // some code
> }
> #replacement(message=“some comment”), available=iOS 9.0)
> func fetchProjects(query query : String?, scope : String?) {
>    // some code
> }
> #replacement(message=“some comment 2”, available=iOS 9.0) 
> func fetchProjects((query query : String?, scope : NSPredicate) {
> }
> #enddeprecation

Swift already offers this similar syntax (I'm using a future syntax tweak here):

        @available(iOS, unavailable, renamed: "fetchProjects(query:)")
        func fetchProjects(_ query: String?) { ... }

What if that was extended to allow it to be applied to deprecations, and to 
allow for differences in signature for functions?

        @available(iOS, introduced: 8.0, deprecated: 9.0, renamed: 
"fetchProjects(query:scope:)")
        func fetchProjects(query query: String?) { ... }

Alternatively, we could use a `replaced` keyword to distinguish between simple 
renames and more complicated changes.

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to