Bug 8474 - msc failed to resolve the correct overloading method while csc can
Summary: msc failed to resolve the correct overloading method while csc can
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2012-11-17 07:11 UTC by Lex Li
Modified: 2012-11-19 06:44 UTC (History)
1 user (show)

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

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:
Status:
RESOLVED FIXED

Description Lex Li 2012-11-17 07:11:05 UTC
When trying to compile Bouncy Castle on Mono/openSUSE, msc cannot resolve the correct version of Equals method. 

http://www.lextm.com/2012/11/how-to-compile-bouncy-castle-on.html

    Bouncy Castle 1.7
    Mono 2.10
    openSUSE 12.2

First, you need to download Bouncy Castle source code package from here,

http://www.bouncycastle.org/csharp/

bccrypto-net-1.7-src-ext.zip contains all files we need, so please use this package instead of the other source package, which lacks of a few files.

Second, extract the source files out and use MonoDevelop to open csharp.sln.

Third, allow MonoDevelop to convert the solution to MSBuild format, and then compile crypto project alone.

Fourth, when MonoDevelop warns that on one of the lines, where Equals method cannot be called,

return z.Square().Equals(this) ? z : null;

The same source code compiles without problems on Windows in Visual Studio, as csc can pick up the correct Equals method.

The workaround is to force the msc to use one of the overloading methods, by changing this line to

return z.Square().Equals((object)this) ? z : null;
Comment 1 Lex Li 2012-11-17 07:12:20 UTC
Note that this affects msc 2.0, 3.0, 3.5, and 4.0 profiles.
Comment 2 Marek Safar 2012-11-19 06:11:26 UTC
Already fixed in Mono 3.0
Comment 3 Lex Li 2012-11-19 06:44:08 UTC
Thanks. Good news.