Re: Why is SwitchError an error and how is it unsafe to continue after catching it?

2019-02-25 Thread aliak via Digitalmars-d-learn
On Sunday, 24 February 2019 at 11:05:31 UTC, Alex wrote: On Sunday, 24 February 2019 at 10:53:09 UTC, aliak wrote: [...] There is a semantic difference between a switch and a final switch statement, defined here: https://dlang.org/spec/statement.html#final-switch-statement By this

Re: Why is SwitchError an error and how is it unsafe to continue after catching it?

2019-02-24 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 24 February 2019 at 10:53:09 UTC, aliak wrote: Because from what I understand, an Error is something you should not be catching and represents something unrecoverable. And it the docs say that it's unsafe to continue execution. But the following code is very recoverable and I don't

Re: Why is SwitchError an error and how is it unsafe to continue after catching it?

2019-02-24 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 24, 2019 5:42:32 AM MST Dennis via Digitalmars-d-learn wrote: > On Sunday, 24 February 2019 at 10:53:09 UTC, aliak wrote: > > But the following code is very recoverable and I don't see how > > > it's unsafe to continue executing: > There is no guarantee that a final switch

Re: Why is SwitchError an error and how is it unsafe to continue after catching it?

2019-02-24 Thread Dennis via Digitalmars-d-learn
On Sunday, 24 February 2019 at 10:53:09 UTC, aliak wrote: But the following code is very recoverable and I don't see how it's unsafe to continue executing: There is no guarantee that a final switch throws an Error. From what I've heard of Walter [1] (though I can't find it in the spec), the

Re: Why is SwitchError an error and how is it unsafe to continue after catching it?

2019-02-24 Thread Alex via Digitalmars-d-learn
On Sunday, 24 February 2019 at 10:53:09 UTC, aliak wrote: Because from what I understand, an Error is something you should not be catching and represents something unrecoverable. And it the docs say that it's unsafe to continue execution. But the following code is very recoverable and I don't