Bug 325447 (MONO82780) - For some cases the runtimes fails to resolve constrained methods
Summary: For some cases the runtimes fails to resolve constrained methods
Status: RESOLVED MOVED
Alias: MONO82780
Product: Mono: Runtime
Classification: Mono
Component: generics (show other bugs)
Version: 1.2
Hardware: Other All
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Martin Baulig
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-10 15:59 UTC by Jean-Baptiste Evain
Modified: 2007-09-15 21:24 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:53:05 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"