> On Jun 1, 2016, at 9:15 AM, Erica Sadun <[email protected]> wrote:
> 
> Or, to be honest:
> 
> /// Offers user-facing public assert configuration test
> @_transparent
> public
> func isDebugAssertConfiguration() -> Bool {
>   return _isDebugAssertConfiguration()
> }
> 
> which covers, I believe, about 98% of the demand for this feature
> 
> -- E


Following up to myself, now that I'm actually using this, I realize that 
avoiding using a build configuration test might not be the best idea from the 
developer experience side of things: 

main.swift:7:9: warning: will never be executed
        print("Not debug assert configuration")
        ^
main.swift:4:8: note: condition always evaluates to true
    if isDebugAssertConfiguration() {
       ^
Testing debug assertion

Whereas going with if #if debugassert() would simply make code "disappear".

-- E

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

Reply via email to