Bug 19754 - Overload resolution should prefer overload with missing optional parameter over params
Summary: Overload resolution should prefer overload with missing optional parameter ov...
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 3.4.0
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2014-05-14 06:09 UTC by Daniel Grunwald
Modified: 2014-05-28 12:02 UTC (History)
1 user (show)

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

Test case (343 bytes, text/x-csharp)
2014-05-14 06:11 UTC, Daniel Grunwald
Test case (fixed) (339 bytes, text/x-csharp)
2014-05-28 10:41 UTC, Daniel Grunwald

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 Daniel Grunwald 2014-05-14 06:09:52 UTC
Using Mono 3.4.0 or the current HEAD (1495baabf), compiling and running the attached program produces the output "FAIL". Doing the same with the Microsoft compiler (.NET 4.5.1) produces "PASS".

public static void M(object obj, bool b = false)
public static void M(object obj, params string[] args)

Call: M(null);

csc on .NET 4.5.1 picks M(object, params string[])
Mono 3.4.0 picks M(object, bool).
Comment 1 Daniel Grunwald 2014-05-14 06:11:07 UTC
Created attachment 6805 [details]
Test case
Comment 2 Marek Safar 2014-05-27 08:46:00 UTC
Tested with Mono and Microsoft (R) Visual C# Compiler version 12.0.30324.0 for C# 5 and both print FAIL for attached test case.
Comment 3 Daniel Grunwald 2014-05-28 10:29:04 UTC
Weird, I'll have to look into whether I made a mistake writing the reduced test case.
There's definitely a Mono bug somewhere here -- our software compiles fine with the Microsoft compiler and with Mono 3.2.3, but not with Mono 3.4.0.
Comment 4 Daniel Grunwald 2014-05-28 10:41:04 UTC
Created attachment 6890 [details]
Test case (fixed)

Sorry for the incorrect testcase, looks like I uploaded a different version of the file than I tested with.
The new testcase should demonstrate the bug.
Comment 5 Marek Safar 2014-05-28 12:02:40 UTC
Fixed in master