Bug 10967 - Operator Overload Compile Error: call is ambiguous
Summary: Operator Overload Compile Error: call is ambiguous
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2013-03-07 11:27 UTC by Scott Stephens
Modified: 2013-03-08 17:47 UTC (History)
1 user (show)

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:

Description Scott Stephens 2013-03-07 11:27:31 UTC
Found a case where the .NET compiler works fine, but the Mono 3.0.6 compiler fails.  It's the mathnet-numerics project: https://github.com/mathnet/mathnet-numerics.

When building the project in Xamarin Studio 4.0.1, it works under .NET/XBuild, but fails under Mono 3.0.6 (either XBuild or standard). I get 28 errors, all of the same type.  Here's a representative error:

C:\Users\rock361\Development\thirdpartywork\mathnet-numerics\src\Examples\LinearAlgebra\MatrixTransposeAndInverse.cs(28,28): Error CS0121: The call is ambiguous between the following methods or properties: `MathNet.Numerics.LinearAlgebra.Generic.Matrix<double>.operator *(MathNet.Numerics.LinearAlgebra.Generic.Matrix<double>, MathNet.Numerics.LinearAlgebra.Generic.Matrix<double>)' and `MathNet.Numerics.LinearAlgebra.Generic.Matrix<double>.operator *(MathNet.Numerics.LinearAlgebra.Generic.Matrix<double>, MathNet.Numerics.LinearAlgebra.Generic.Matrix<double>)' (CS0121) (Examples)

This error message seems wrong on its face, how could the call be ambiguous between the same method? And as I said, it works under .NET.

I tried to come up with a minimal example that reproduces the behavior, but I wasn't able to figure out what exactly about the setup was causing the problem.  Nonetheless, it should be reproducible by just building the whole mathnet-numerics project.

I'm on a Windows 7 64 bit machine.
Comment 1 Marek Safar 2013-03-08 17:47:24 UTC
Fixed in master