[Mono-dev] Generic type parameter member lookup bug in 2.8.1

Tom Philpot tom.philpot at logos.com
Mon Dec 6 16:10:08 EST 2010


Using the latest code from git, I encountered another regression from 2.6 (similar to the problem I reported here: https://bugzilla.novell.com/show_bug.cgi?id=653710). I discovered this in mono-2-8 from git, but confirmed that it exists on the master too.

The following code fails to compile with a CS1061 error complaining that Start() is not defined for W. In looking at the code, it appears that the MemberCache.FindMembers (..) method only looks  at the BaseType and not the TypeArguments to determine which members should be available.

namespace Application
{
public class Z {}

public interface IGenericInterface<T>
{
T Start { get; }
}

public class A<Y, W>
where Y : Z, IGenericInterface<Y>
where W : Y
{
protected void SomeOtherOperation (W w)
{
w.Start ();
}
}

public class Foo { public static void Main () {}}
}

I've already opened https://bugzilla.novell.com/show_bug.cgi?id=657797 for this error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20101206/a435fea9/attachment.html 


More information about the Mono-devel-list mailing list