> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Barry Kelly
> Sent: 29 February 2008 15:47
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] extensions methods and type
inference....
> 
> "Nicholls, Mark" <[EMAIL PROTECTED]> wrote:
> 
> > At best I think the error message to be misleading and there is a
> > significant hole in the type inference mechanism,
> 
> I disagree that there is a hole. I'm pretty sure subtyping constraints
> like in this example should never be used in inference, because it
would
> imply that adding a new ancestor interface to a class might be a
> breaking change, 

Ahhh very good point...

Though to be honest I don't like the implementation anyway, I would
prefer it to infer the types and insert them for you (like intellisense)
rather than infer them simply by signature, then the breaking change
problem is fixed.
 
> which should be pretty counter-intuitive when you think
> about it. In the functional world, subtyping and polymorphism are
known
> not to play particularly well with type inference.

Yes, I've dabbled in Haskell and it hurt my brain.... 

> 
> > at worst it wouldn't
> > surprise me if there is a bug in there...the error would seem to
imply
> > it thinks it's proved no solution exists, when at least one does.
> 
> I think the error message is poor. I guess that the type inference is
> using early sanity-checking to reduce the contenders: when the number
of
> generic type arguments is greater than the uses of the generic type
> arguments in the method declaration, it's excluding that method from
the
> list of inferable candidates early on, but when it gets to the
inference
> resolver it finds it has no potential methods to work with, so it
issues
> this error message.

Yep...seems like a sensible option, if they raised a sensible error,
then I would be perfectly happy.

> 
> -- Barry
> 
> --
> http://barrkel.blogspot.com/
> 
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
> 
> View archives and manage your subscription(s) at
> http://discuss.develop.com



CONFIDENTIALITY NOTICE

This e-mail (and any attached files) is confidential and protected by 
copyright (and other intellectual property rights). If you are not the 
intended recipient please e-mail the sender and then delete the email and 
any attached files immediately. Any further use or dissemination is 
prohibited.

While MTV Networks Europe has taken steps to ensure that this email and 
any attachments are virus free, it is your responsibility to ensure that 
this message and any attachments are virus free and do not affect your 
systems / data.

Communicating by email is not 100% secure and carries risks such as delay, 
data corruption, non-delivery, wrongful interception and unauthorised 
amendment. If you communicate with us by e-mail, you acknowledge and 
assume these risks, and you agree to take appropriate measures to minimise 
these risks when e-mailing us. 

MTV Networks International, MTV Networks UK & Ireland, Greenhouse, 
Nickelodeon Viacom Consumer Products, VBSi, Viacom Brand Solutions 
International and Comedy Central are all trading names of MTV Networks 
Europe.  MTV Networks Europe is a partnership between MTV Networks Europe 
Inc. and Viacom Networks Europe Inc.  Address for service in Great Britain 
is UK House, 180 Oxford Street, London W1D 1DS, UK.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to