Re: knowing the interfaces that an object implements
- From: "Jakob Christensen" <jch@xxxxxxxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 01:00:06 -0700
If the connection variable is declared as Object the VB compiler
unfortunately does not complain even with Option Explicit on. This is one of
the "features" of VB.net (and one of the reasons that I prefer C# :-))
Regards, Jakob.
"Jon Skeet [C# MVP]" wrote:
> 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
>
.
- Follow-Ups:
- Re: knowing the interfaces that an object implements
- From: Jon Skeet [C# MVP]
- Re: knowing the interfaces that an object implements
- 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: Compact framework threads and forms problem
- Next by Date: "Not Responding" Message in Windows Form Application
- Previous by thread: Re: knowing the interfaces that an object implements
- Next by thread: Re: knowing the interfaces that an object implements
- Index(es):
Relevant Pages
|