Iaroslav Postovalov
10/31/2020, 5:06 PMcontract
in this function correct?Arkadii Ivanov
10/31/2020, 7:25 PMlouiscad
10/31/2020, 10:08 PMblock
might throw and doesn't assume it'd succeed, regardless of the contract.
You can check the behavior by having an expression evaluating to Nothing
in the passed block. You can also check also
, and that applies to apply
, let alone let
which works the same way as well, with with
too. All these implementations have such a contract, and you can throw from the passed lambda.Arkadii Ivanov
10/31/2020, 10:27 PMblock
throws, but the function invocation prior block
execution.toIntOrFail
is executed before block
ilya.gorbunov
11/01/2020, 3:19 AMblock
was executed once, which is in agreement with this contract.Iaroslav Postovalov
11/01/2020, 7:01 AMlouiscad
11/01/2020, 8:44 AMblock
without breaking the code in any way.Arkadii Ivanov
11/01/2020, 9:32 AM