"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, 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.

> 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.

-- Barry

-- 
http://barrkel.blogspot.com/

===================================
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