Bug 22989 - Incorrect reporting of wrong parameters to function call within lambda
Summary: Incorrect reporting of wrong parameters to function call within lambda
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2014-09-15 06:44 UTC by mattbenic@gmail.com
Modified: 2014-09-18 18:09 UTC (History)
4 users (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 mattbenic@gmail.com 2014-09-15 06:44:07 UTC
Given the (partial) class snippets below, upon building the editor will incorrectly report being unable to match parameters on this.ShowWordInstruction as mismatched parameters on NavigationItem.RightBarButtonItem:

Error CS1739: The best overloaded method match for `MonoTouch.UIKit.UIBarButtonItem.UIBarButtonItem(MonoTouch.UIKit.UIImage, MonoTouch.UIKit.UIBarButtonItemStyle, System.EventHandler)' does not contain a parameter named `title'
Error CS1502: The best overloaded method match for `MonoTouch.UIKit.UIBarButtonItem.UIBarButtonItem(MonoTouch.UIKit.UIImage, MonoTouch.UIKit.UIBarButtonItemStyle, System.EventHandler)' has some invalid arguments
Error CS1503: Argument `#1' cannot convert `string' expression to type `MonoTouch.UIKit.UIImage'


partial class ConversationTableViewController : UITableViewController
    private InstructionSession instructionSession;
    private Action conversationCompleted;

    public ConversationTableViewController (IntPtr handle) : base (handle)

    public override void ViewWillAppear(bool animated)

        NavigationItem.RightBarButtonItem = new UIBarButtonItem(
            title: ">",
            style: UIBarButtonItemStyle.Plain,
            handler: (s, e) =>
                // Note this should have two parameters


public static class UIViewControllerExtensions
    public static void ShowWordInstruction(
        this UIViewController viewController, 
        InstructionSession instructionSession,
        Action conversationCompleted)
Comment 1 Parmendra Kumar 2014-09-15 10:58:38 UTC
I have checked this issue and able to reproduce it. To reproduce this issue I have followed these steps:
1. Create a iPhone application.
2. Open controller.cs file and use use the sample code given in bug description
3. Debug the application
4. This application throw 3 error.

ErrorLog: https://gist.github.com/anonymous/cf39a231639239e09214
Build Log: https://gist.github.com/anonymous/cf2b754d2797223136ad

Environment Info:
=== Xamarin Studio ===

Version 5.3 (build 441)
Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4
	Mono 3.8.0 ((no/45d0ba1)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000009

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 77efa3f
Build date: 2014-08-26 07:59:55-0400

=== Xamarin.Android ===

Version: 4.16.0 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 503000441
Git revision: befb6aa1176d37a5f678f4274f340a0159091b7a
Build date: 2014-09-08 17:57:02-04
Xamarin addins: 6dc7c388e31fdfc8014689839d37de0d4622435c

=== Operating System ===

Mac OS X 10.9.4
Darwin ShrutiMac.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 2 Mike Krüger 2014-09-16 08:41:57 UTC
Seems to be a compiler problem - reassigning.
Comment 3 Marek Safar 2014-09-18 18:09:50 UTC
Fixed in master