Bug 319459 (MONO76625) - [GMCS] CS0266: extra cast is required from IFoo<T> to IFoo where IFoo<T> is IFoo
Summary: [GMCS] CS0266: extra cast is required from IFoo<T> to IFoo where IFoo<T> is IFoo
Status: RESOLVED FIXED
Alias: MONO76625
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Minor
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-03 14:13 UTC by Atsushi Enomoto
Modified: 2007-09-15 21:24 UTC (History)
0 users

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 19:37:04 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".