I think Sebastian already touched on this issue, but I wanted to shine a
little more light on it.  If the Something class were defined as below and x
was not null wouldn't the Foo method throw an exception incorrectly stating
that x was null?


class Something 
{
    public Something()
    {
    }

    public void DoSomething()
    {
        throw new NullReferenceException();
    }
}

void Foo (Something x) 
{ 
    try { 
        x.DoSomething (); 
    } catch (NullReferenceException e){ 
        if (x == null) 
             throw new ArgumentNullException ("x"); 
        else 
              throw; 
    } 
    x.AndThenMore (); 
} 











--
View this message in context: 
http://mono.1490590.n4.nabble.com/Faster-tp3402943p3404445.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to