Hi Sergej,

This is a good idea, but there are some additional things to consider. In some 
cases, methods are partially unimplemented (with edge cases, or at least less 
common cases remaining unfinished). The availability macro can’t reflect that 
status.

In other cases, we want to partially implement one function but still call 
through to an unimplemented function. The entire call may fail with the assert, 
but at least we have part of the implementation in place.

- Tony

> On May 10, 2017, at 4:01 PM, Sergej Jaskiewicz via swift-corelibs-dev 
> <swift-corelibs-dev@swift.org> wrote:
> 
> I was wondering why cannot we just mark all the methods/properties/functions 
> in Swift Foundation that are NSUnimplemented or call a subroutine that is 
> NSUnimplemented like this:
> 
> @available(*, unavailable, message: “foo is not implemented yet”)
> func foo() { NSUnimplemented() }
> 
> In this case we can be sure at compile time that we don’t use code that will 
> definitely crash.
> _______________________________________________
> swift-corelibs-dev mailing list
> swift-corelibs-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Reply via email to