Bug 25361 - Xamarin Studio Mac compiler can not unambiguous, but compiling with Visual Studio does
Summary: Xamarin Studio Mac compiler can not unambiguous, but compiling with Visual St...
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2014-12-13 03:21 UTC by softlion
Modified: 2015-01-06 04:42 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 softlion 2014-12-13 03:21:28 UTC
I'm compiling/running the same project with visual studio and Xamarin Studio Mac.
With visual studio and a mac build host it compiles and runs fine.
With Xamarin Studio Mac it fails to compile with this error:

SettingsViewModel.cs(39,39): Error CS0121: The call is ambiguous between the following methods or properties:

 `Chance.MvvmCross.Plugins.UserInteraction.IUserInteraction.Confirm(string, System.Action, string, string, string)' 
and `Chance.MvvmCross.Plugins.UserInteraction.IUserInteraction.Confirm(string, System.Action<bool>, string, string, string)'
 (CS0121) (Intouch.Core)


The compiled source line is:
var ok = await Ui.Confirm("ConfirmSignOut", null, "Yes","No").ConfigureAwait(false);

This method signatures are:
Task<bool> Confirm (string message, string title = null, string okButton = "OK", string cancelButton = "Cancel");
void Confirm (string message, Action<bool> answer, string title = null, string okButton = "OK", string cancelButton = "Cancel");
void Confirm (string message, Action okClicked, string title = null, string okButton = "OK", string cancelButton = "Cancel");

So the mac compiler does not understand that it should take the first signature, because it is the only one returning something, and instead try to unambiguate between the 2 other signatures, which is not possible. 
But the Visual Studio compiler does it right and take the first signature correctly.

This is a very old bug i see since 9 months. 
I took some time today to post it.





Xamarin Studio
Version 5.7 (build 646)
Installation UUID: 9196a473-93bf-4363-8f90-dab3a34944e4
Runtime:
	Mono 3.12.0 ((detached/dc0ce1d)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000066

Xamarin.Android
Not Installed

Apple Developer Tools
Xcode 6.1 (6604)
Build 6A1052d

Xamarin.Mac
Not Installed

Xamarin.iOS
Version: 8.6.0.22 (Business Edition)
Hash: 142934d
Branch: 
Build date: 2014-12-09 10:40:45-0500

Build Information
Release ID: 507000646
Git revision: 4574f534cc8c822ac1a4b2f31450250afb6511d3
Build date: 2014-12-09 16:28:52-05
Xamarin addins: c3c87b666323c163f0ad02618d1753533cf0a4f9
Comment 1 Marek Safar 2015-01-06 04:42:07 UTC
Already fixed in mono master