[swift-evolution] [Proposal] Rename fatalError() API

Alex Blewitt alblue at apple.com
Mon Jan 9 04:18:32 CST 2017


> On 6 Jan 2017, at 23:15, David Sweeris via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On Jan 6, 2017, at 2:58 PM, D. Felipe Torres via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> Yeah, it was meant as a joke. 
>> I'm well aware of the uses you write about, I do that myself but felt like doing this piece based on the particular use case described in the "proposal"
> 
> 
> I wouldn’t be horribly opposed to adding a function called “willItToCompile”, “compileAnyway”, “noSrslyIDontCare”, or some other equally explicit name, simply because that way it’d be easy to ensure that all such code was revisited before shipping the product.
> 
> I wouldn’t be horribly in favor, either, because putting a special phrase in the string that you pass to fatalError() does the same thing, and doesn’t complicate the language.

There's already NSUnimplemented for this kind of use case, and NSRequiresConcreteImplementation for catching subclasses that fail to implement a required (but perhaps optional) method, although these are statement based rather than expression based.

Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170109/72b201d5/attachment.html>


More information about the swift-evolution mailing list