[swift-corelibs-dev] incomplete implementation warning functions
anthony.parker at apple.com
Thu Jan 21 12:04:15 CST 2016
The reason we chose fatalError() was that we felt that the safest course of action when reaching unimplemented code was to immediately crash. If we continue instead, aren’t we putting the app into an unknown state?
> On Jan 21, 2016, at 2:55 AM, Will Stanton via swift-corelibs-dev <swift-corelibs-dev at swift.org> wrote:
> I would like to propose functions that warn about incomplete implementations without calling NSUnimplemented/fatalError. They could provide a standard interface for reminding/warning about incomplete implementations while things are being built.
> I was thinking of two utility functions:
> 1) NSWarnIncompleteImplementation: Prints a warning message once. Can make potential issues clear (without flooding the console), particularly for classes where most of the implementation is there, but something could fail for certain parameters/configurations.
> 2) NSWarnUnimplemented: prints a warning on each call, ex. in a setter that doesn’t do anything
> Something like:
> Are there are any recommendations/thoughts about incorporating these functions?
> Will Stanton
> swift-corelibs-dev mailing list
> swift-corelibs-dev at swift.org
More information about the swift-corelibs-dev