Why doesn't the compiler at least warn on this == null

Posted by Andrei Rinea on Stack Overflow See other posts from Stack Overflow or by Andrei Rinea
Published on 2010-03-17T16:41:12Z Indexed on 2010/03/17 16:51 UTC
Read the original article Hit count: 355

Filed under:
|
|
|

Why does the C# compiler not even complain with a warning on this code? :

if (this == null)
{
   // ...
}

Obviously the condition will never be satisfied..

© Stack Overflow or respective owner

Related posts about c#

Related posts about compiler