reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dhruv Mahajan <dhruv.maha...@gmail.com>
Subject Re: [DISCUSS] Deprecate Exceptions.Throw?
Date Fri, 27 May 2016 00:56:06 GMT
+1 on this. This also happens when I check variables for null and then use
"Exceptions". Resharper thinks that I have not done anything regarding
variable being null and keeps on giving me warnings when I later access
this variable.

Dhruv

On Thu, May 26, 2016 at 4:09 PM, Markus Weimer <markus@weimo.de> wrote:

> Hi,
>
> `Exceptions.Throw()` is used in some of our C# code instead of a simple
> `throw` call. This confuses the compiler, as it doesn't know we throw an
> exception. We frequently have code like this:
>
> ```
>   Exceptions.Throw(new ...);
>   return null;
> ```
>
> The `return null` is only needed because the compiler can't know that the
> control flow ended in the line before. I find this very confusing.
>
> Hence, I'd like to deprecate the whole `Exceptions` class. What features
> would we loose if we did?
>
> Markus
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message