Re: knowing the interfaces that an object implements
- From: "Nick Hall" <nickh@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 12:44:06 +0100
Well what do you know I completely missed the lack of explicit cast! Talk
about seeing what you expect to see :-)
Nick Hall
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1cdb208c7c0519de98c055@xxxxxxxxxxxxxxxxxxxxxxx
> Nick Hall <nickh@xxxxxxxxxxxxxxxxxx> wrote:
>> It's not evaluated until runtime - therefore it actually does work. It
>> uses
>> the IL instruction isinst to make the determination.
>
> The "if" does, but the call to Dispose should fail at compile time,
> because the compiler doesn't know that connection implements
> IDisposable. Of course, with Option Strict turned off it would be okay,
> but personally I think type-safety is rather important :)
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too
.
- References:
- knowing the interfaces that an object implements
- From: Sanjay
- Re: knowing the interfaces that an object implements
- From: LOZANO-MORÁN, Gabriel
- Re: knowing the interfaces that an object implements
- From: Jakob Christensen
- Re: knowing the interfaces that an object implements
- From: Tiberiu Covaci[MCAD.NET]
- Re: knowing the interfaces that an object implements
- From: LOZANO-MORÁN, Gabriel
- Re: knowing the interfaces that an object implements
- From: Sanjay
- Re: knowing the interfaces that an object implements
- From: Jakob Christensen
- Re: knowing the interfaces that an object implements
- From: Jon Skeet [C# MVP]
- Re: knowing the interfaces that an object implements
- From: Nick Hall
- Re: knowing the interfaces that an object implements
- From: Jon Skeet [C# MVP]
- knowing the interfaces that an object implements
- Prev by Date: Re: Stored Procedure Newbie needs help
- Next by Date: Re: object clean up ?
- Previous by thread: Re: knowing the interfaces that an object implements
- Next by thread: Re: knowing the interfaces that an object implements
- Index(es):