Bugzilla – Bug 319459
[GMCS] CS0266: extra cast is required from IFoo<T> to IFoo where IFoo<T> is IFoo
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by atsushi@ximian.com 2005-11-03 07:13:29 MST ---- An extra cast is required from IFoo<T> to IFoo where IFoo<T> is IFoo. public interface IFoo { } public interface IFoo<T> : IFoo { } public class Test { public IFoo GetFoo () { return GetFooGeneric<object> (); } public IFoo<T> GetFooGeneric<T> () { return default (IFoo<T>); } } Actual Results: cast.cs(5,26): error CS0266: Cannot implicitly convert type `IFoo<System.Object> ' to `IFoo'. An explicit conversion exists (are you missing a cast?) Expected Results: no CS0266 error How often does this happen? consistently. ---- Additional Comments From martin@ximian.com 2005-11-03 08:41:26 MST ---- Should be easy; now looking at it. ---- Additional Comments From martin@ximian.com 2005-11-03 11:14:49 MST ---- Ok, it's a runtime issue and more difficult than I expected :-( Still working on it. ---- Additional Comments From atsushi@ximian.com 2005-11-04 12:06:11 MST ---- Actually this bug is not so important; we could add explicit cast until it is fixed. ---- Additional Comments From martin@ximian.com 2006-01-09 05:39:48 MST ---- Post-GUAM bug-fixing pass: ASSIGNED -> NEW ---- Additional Comments From martin@ximian.com 2006-01-12 14:31:54 MST ---- This one was really difficult to figure out, but in the end it had a very simple fix - which is now in SVN :-) Unknown operating system unknown. Setting to default OS "Other".