Bug 1389 - 2.10.5 - C# compiler reports error when it shouldn't w/generics
Summary: 2.10.5 - C# compiler reports error when it shouldn't w/generics
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2011-10-10 01:48 UTC by Brian Luczkiewicz
Modified: 2011-10-10 13:41 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

compile this with 'dmcs t.cs' to reproduce the bug (464 bytes, application/octet-stream)
2011-10-10 01:48 UTC, Brian Luczkiewicz

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Brian Luczkiewicz 2011-10-10 01:48:10 UTC
Created attachment 656 [details]
compile this with 'dmcs t.cs' to reproduce the bug

To reproduce:

1. download attached file, name it t.cs
2. compile with 'dmcs t.cs'

Expected result: 

the file compiles successfully

Actual result:

the compiler complains:

t.cs(20,16): error CS1502: The best overloaded method match for `FooHolder.AddFoo(IFoo)' has some invalid arguments
t.cs(6,17): (Location of the symbol related to previous error)
t.cs(20,16): error CS1503: Argument `#1' cannot convert `BazBar<D,F>' expression to type `IFoo'
Compilation failed: 2 error(s), 0 warnings

These errors are incorrect because BazBar<D,F> does in fact implement IFoo. The compiler should not be complaining about this.

I've reproduced this on mono 2.10.5 on mac os x.
Comment 1 Marek Safar 2011-10-10 13:41:36 UTC
Fixed in master