[Swift-devel] assertion behavior

Tim Armstrong tim.g.armstrong at gmail.com
Fri Mar 27 09:39:56 CDT 2015


I don't think it makes sense to treat it as a soft error.

The primary use case for assertions is the Swift/T test suite and there's
no reason to continue running after an assertion failure.

If a user wants to use them in their own scripts, they're intended to catch
bugs or unintended behaviour.  If an assertion fails, the script is not
doing what it's meant to be doing.  I don't see any reason to keep on
running a buggy script that failed an assertion, and I see plenty of
reasons not to keep it running.

If users want to disable their assertions there is support for that.

- Tim

On 27 March 2015 at 09:20, Michael Wilde <wilde at anl.gov> wrote:

>  Does "terminate immediately" need to always be immediate or should/could
> it integrate with the Swift/K notion of "soft errors"?
>
> I.e. an assert failure is treated like a failing function; that in turn as
> handled as the soft-error property specifies.
> - Mike
>
>
>
> On 3/25/15 10:24 PM, Tim Armstrong wrote:
>
>  The program terminates immediately with an error message.
>
> There's a compile-time option to disable assertions if needed.  It's
> actually a little weird in that it syntactically removes the statement - it
> doesn't evaluate the arguments to the funciton.
>
>  - Tim
>
> On 25 March 2015 at 22:09, Mihael Hategan <hategan at mcs.anl.gov> wrote:
>
>> Hi,
>>
>> In Swift/T, what happens when an assertion fails?
>>
>> Mihael
>>
>> _______________________________________________
>> Swift-devel mailing list
>> Swift-devel at ci.uchicago.edu
>> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
>>
>
>
>
> _______________________________________________
> Swift-devel mailing listSwift-devel at ci.uchicago.eduhttps://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
>
>
> --
> Michael Wilde
> Mathematics and Computer Science          Computation Institute
> Argonne National Laboratory               The University of Chicago
>
>
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20150327/6c3e1353/attachment.html>


More information about the Swift-devel mailing list