deterministic icon indicating copy to clipboard operation
deterministic copied to clipboard

Failure in try! block

Open angdev opened this issue 9 years ago • 3 comments

Hi. I have a question about behavior of try!.

try! { 1 } # => Success(1)
try! { Success(1) } # => Success(1)
try! { Failure(1) } # => Success(Failure(1))

Is this behavior intended? Thanks.

angdev avatar Jun 22 '16 05:06 angdev

No. Shouldn't be like that

Piotr

On 22 Jun 2016 07:49 +0200, Hong [email protected], wrote:

Hi. I have a question about behavior oftry!.

try! {1}# =>Success(1)try! {Success(1) }# =>Success(1)try! {Failure(1) }#=>Success(Failure(1))

Is this behavior intended? Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly,view it on GitHub(https://github.com/pzol/deterministic/issues/32), ormute the thread(https://github.com/notifications/unsubscribe/AAI2z9MzH8uwDpOWm3oJ2Ed1BU0tFpZoks5qOMzWgaJpZM4I7bXP).

pzol avatar Jun 22 '16 06:06 pzol

Then, below is correct behavior?

try! { 1 } # => Success(1)
try! { Success(1) } # => Success(1)
try! { Failure(1) } # => Failure(1)

angdev avatar Jun 22 '16 16:06 angdev

Yes

Piotr

On 22 Jun 2016 18:02 +0200, Hong [email protected], wrote:

Then, below is correct behavior?

try! {1}# =>Success(1)try! {Success(1) }# =>Success(1)try! {Failure(1) }# =>Failure(1)

— You are receiving this because you commented. Reply to this email directly,view it on GitHub(https://github.com/pzol/deterministic/issues/32#issuecomment-227791701), ormute the thread(https://github.com/notifications/unsubscribe/AAI2z8vUQ_tlWrq2ZzOOx9BBx16gjYgtks5qOVxwgaJpZM4I7bXP).

pzol avatar Jun 22 '16 16:06 pzol