is collectException working for every exceptions ?

Ali Çehreli acehreli at yahoo.com
Tue Mar 19 07:11:36 UTC 2019


On 03/19/2019 12:00 AM, Roman Sztergbaum wrote:
> On Tuesday, 19 March 2019 at 00:07:44 UTC, Ali Çehreli wrote:
>> On 03/18/2019 11:54 AM, Roman Sztergbaum wrote:
>> > [...]
>> with the
>> > [...]
>>
>> Andre Pany has already explained. Otherwise, I was going to say 
>> "collectException can collect Exceptions, not exceptions." ;)
>>
>> [...]
> 
> Hello,
> 
> What happen if the contract is not respected in this case ? since you 
> dont have any assert inside the contract ?
> 
> Thank's a lot !

You didn't quote that part but I think you're referring to the 
expression-based contracts. Actually, the asserts are still there but 
the syntax is cleaner. That syntax was introduced in 2.081.0:

   https://dlang.org/changelog/2.081.0.html#expression-based_contract_syntax

I have a section about them as well:

 
http://ddili.org/ders/d.en/contracts.html#ix_contracts.expression-based%20contracts

Ali


More information about the Digitalmars-d-learn mailing list