Bug 27430 - btouch doesn't escape identifiers with the same name as keywords
Summary: btouch doesn't escape identifiers with the same name as keywords
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: XI 8.6.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Alex Soto [MSFT]
Depends on:
Reported: 2015-02-25 15:26 UTC by Dave Dunkin
Modified: 2015-03-05 01:42 UTC (History)
3 users (show)

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

Project demonstrating the compile error (3.58 KB, application/zip)
2015-02-25 15:26 UTC, Dave Dunkin

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 Developer Community or GitHub 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 Dave Dunkin 2015-02-25 15:26:30 UTC
If a parameter to a bound method has a name that is a keyword, but is escaped with @, the btouch generated file does not properly escape the identifier, resulting in compile errors.

namespace Foo.BindingBugs
     [BaseType (typeof (NSObject))]
     interface Widget {
		[Export ("doSomething:atIndex:")]
		void DoSomething (NSObject @object, int index);



namespace Foo.BindingBugs {
	[Register("Widget", true)]
	public unsafe partial class Widget : NSObject {
		[Export ("doSomething:atIndex:")]
		public virtual void DoSomething (NSObject object, int index)
			if (object == null)
				throw new ArgumentNullException ("object");
			if (IsDirectBinding) {
				BindingBugs.Messaging.void_objc_msgSend_IntPtr_int (this.Handle, Selector.GetHandle ("doSomething:atIndex:"), object.Handle, index);
			} else {
				BindingBugs.Messaging.void_objc_msgSendSuper_IntPtr_int (this.SuperHandle, Selector.GetHandle ("doSomething:atIndex:"), object.Handle, index);
Comment 1 Dave Dunkin 2015-02-25 15:26:54 UTC
Created attachment 10033 [details]
Project demonstrating the compile error
Comment 2 Alex Soto [MSFT] 2015-03-04 20:16:30 UTC
I can confirm this working on a fix
Comment 3 Alex Soto [MSFT] 2015-03-05 01:42:27 UTC
Fixed in maccore master 5abd763c71f0777d71a852fcd8009fb2f5b79568

@Dave Thanks for reporting this :)

@QA: Added test case