Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 19335 [details]
Class1.cs - compile this to a separate assembly
We have the C# code that uses an interface with a number of overloads for a certain method. If that interface is defined in the same source file as the code that uses it, it compiles properly. If the interface is defined in an separate referenced assembly though, the C# compiler reports an error, indicating that the proper overload cannot be found.
To reproduce this:
1. Compile the attached Class1.cs to a separate assembly.
2. Compiler the attached Program.cs and reference the separate assembly (via -r:)
The following compiler error will occur:
D:\scratch\ScratchCSharpProject\ScratchCSharpProject\Program.cs(72,13): error CS1502: The best overloaded method match for `SeparateAssembly.IGenericAction<T1,T2>.AddAction(SeparateAssembly.IGenericAction)' has some invalid arguments
D:\scratch\ScratchCSharpProject\SeparateAssembly\bin\Debug\SeparateAssembly.dll (Location of the symbol related to previous error)
D:\scratch\ScratchCSharpProject\ScratchCSharpProject\Program.cs(72,23): error CS1503: Argument `#1' cannot convert `SeparateAssembly.IGenericAction<T2,T1>' expression to type `SeparateAssembly.IGenericAction'
Compilation failed: 2 error(s), 0 warnings
Note that if the commented-out code in Program.cs is used instead of the separate assembly, the problem will not occur. The Microsoft C# compiler compiles this code properly, so I think it is valid C# code.
Created attachment 19336 [details]
This is the Program.cs file.
Fixed in master