Bug 24700 - NSSavePanel.BeginSheet has two equivalent overloads
Summary: NSSavePanel.BeginSheet has two equivalent overloads
Status: CONFIRMED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) (show other bugs)
Version: 1.11.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-20 12:08 UTC by Frank A. Krueger
Modified: 2016-09-26 22:03 UTC (History)
5 users (show)

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


Attachments
Shows overload resolution can't work (273.20 KB, image/png)
2014-11-21 07:26 UTC, Frank A. Krueger
Details
Shows BeginSheet in NSWindow (1.11 MB, image/png)
2014-11-21 07:27 UTC, Frank A. Krueger
Details
BeginSheet in NSSavePanel (1.08 MB, image/png)
2014-11-21 07:28 UTC, Frank A. Krueger
Details

Description Frank A. Krueger 2014-11-20 12:08:23 UTC
In 1.11.1.89 NSSavePanel.BeginSheet has two overloads that take equivalent args - namely the continuation.

Once it's specified as NSSavePanelCompletion (which is great), and another is Action<int> which is the same delegate type.

Any calls to this function using a lambda gives an unspecified overload error.

Please just pick one.
Comment 1 Udham Singh 2014-11-21 05:28:10 UTC
I have checked this issue and observed that NSSavePanel.BeginSheet has only one overload. To check this issue I have implemented the code below and run the app successfully without any error.

public class TestClass : NSSavePanel
	
{

		public TestClass()

		{

		}


		public override void BeginSheet (NSWindow window, NSSavePanelComplete onComplete)

		{

		}
	
}


I have also checked in assembly browser and observed that we have only one method named 'BeginSheet' in class 'NSSavePanel'.

Screencast : http://www.screencast.com/t/wDmjtUeUpBf

Note : I have checked this issue with both Classic and Unified templates and observed the same behaviour.

Could you please have a look on the screencast and let me know if I missed anything.

Environment Info :

=== Xamarin Studio ===

Version 5.5.3 (build 6)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000023

=== Xamarin.Android ===

Version: 4.18.1 (Enterprise Edition)
Android SDK: /Users/xamarin76/Desktop/android-sdk-macosx
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.0    (API level 11)
		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)
		4.5    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.Mac ===

Version: 1.11.1.89 (Enterprise Edition)

=== Xamarin.iOS ===

Version: 8.4.0.16 (Enterprise Edition)
Hash: 80e9ff7
Branch: 
Build date: 2014-10-22 15:09:12-0400

=== Build Information ===

Release ID: 505030006
Git revision: fbe3e9453daf6a3bb9a9709ed22bec35f7c9056b
Build date: 2014-10-23 13:08:38-04
Xamarin addins: e44add2b39de4dd57c0742bb2e620dfad84c64c6

=== Operating System ===

Mac OS X 10.9.4
Darwin Xamarin76s-Mac-mini.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 Frank A. Krueger 2014-11-21 07:25:04 UTC
> I have checked this issue and observed that NSSavePanel.BeginSheet has only one
overload. To check this issue I have implemented the code below and run the app
successfully without any error.

1) You could just look at the assembly and see the duplication. NSSavePanel has a BeginSheet and NSWindow (which it inherits) as a BeginSheet. They take two different but equivalent continuation types. I have attached 3 screen shots to demonstrate this.

2) Your test case is invalid. I specifically mentioned the problem of using lambdas (that require type inference), but your test just overrides one of the overloads. Overriding is not the problem.

-Frank
Comment 3 Frank A. Krueger 2014-11-21 07:26:36 UTC
Created attachment 8830 [details]
Shows overload resolution can't work
Comment 4 Frank A. Krueger 2014-11-21 07:27:08 UTC
Created attachment 8831 [details]
Shows BeginSheet in NSWindow
Comment 5 Frank A. Krueger 2014-11-21 07:28:07 UTC
Created attachment 8832 [details]
BeginSheet in NSSavePanel
Comment 6 Chris Hamons 2014-11-21 09:37:15 UTC
Sorry for the confusion from our QA guy. I can confirm there are two overloads, which can conflict. 

This is a bug. We'll get it fixed up. Thanks for the bug report and trying out the alpha!
Comment 7 Chris Hamons 2014-12-05 16:21:17 UTC
Tim, I think you were looking at this?
Comment 8 Rustam Zaitov 2015-10-09 13:17:15 UTC
It is still here. From my point of view we should rid of custom delegate type

Note You need to log in before you can comment on or make changes to this bug.