Bugzilla – Bug 325447
For some cases the runtimes fails to resolve constrained methods
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by mono@evain.net 2007-09-10 08:59:29 MST ---- Description of Problem: In some cases, the runtime g_warns a missing method when facing a constrained method call. Steps to reproduce the problem: Compile and run: using System; public enum EntityType { Field, Bar, } public interface IMember { EntityType EntityType { get; } } public interface IField : IMember { } public class Field : IField { public EntityType EntityType { get { return EntityType.Field; } } } public abstract class GenericMappedMember<T> : IMember where T : IMember { T _source; public GenericMappedMember (T source) { _source = source; } public T Source { get { return _source; } } public EntityType EntityType { get { return Source.EntityType; } } } public class GenericMappedField : GenericMappedMember<IField>, IField { public GenericMappedField (IField field) : base (field) { } } public class Program { static void Main () { GenericMappedField f = new GenericMappedField (new Field ()); Console.WriteLine (f.EntityType); } } Actual Results: Crash, warning: missing method: IMember.get_EntityType Expected Results: Print Field ---- Additional Comments From lupus@ximian.com 2007-09-10 09:14:36 MST ---- *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO82516 *** This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"