Bug 5874 - Get a warning and error when binding Parse library
Summary: Get a warning and error when binding Parse library
Status: RESOLVED FEATURE
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.2.x
Hardware: Macintosh Mac OS
: --- major
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2012-06-26 17:04 UTC by Chris Hardy [MSFT]
Modified: 2012-07-03 05:00 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 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:
Status:
RESOLVED FEATURE

Description Chris Hardy [MSFT] 2012-06-26 17:04:01 UTC
When trying to bind the Parse library, I get the following warning:
/Users/chrisntr/Projects/MyAndroidApp/ParseLib/obj/Debug/generated/src/Com.Parse.Codec.Binary.Base32.cs(37,37): Warning CS0114: `Com.Parse.Codec.Binary.Base32.IsInAlphabet(sbyte)' hides inherited member `Com.Parse.Codec.Binary.BaseNCodec.IsInAlphabet(sbyte)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword (CS0114) (ParseLib)
and also the following error:
/Users/chrisntr/Projects/MyAndroidApp/ParseLib/obj/Debug/generated/src/Com.Parse.Codec.Binary.Base32.cs(37,37): Error CS0533: `Com.Parse.Codec.Binary.Base32.IsInAlphabet(sbyte)' hides inherited abstract member `Com.Parse.Codec.Binary.BaseNCodec.IsInAlphabet(sbyte)' (CS0533) (ParseLib)

Obviously this shouldn't error and should build as expected.

Library project here: https://www.dropbox.com/s/lv16wbu904li9yt/ParseLibraryBinding.zip
Comment 1 Atsushi Eno 2012-07-03 05:00:48 UTC
This is not a bug. You have to add the following metadata fixup:

	<attr path="/api/package[@name='com.parse.codec.binary']/class[@name='Base32']/method[@name='isInAlphabet']" name="visibility">protected</attr>

It is because Base32#isInAlphabet() is overriden as public while the base method is protected in the jar. C# does not allow that and we can't (shouldn't) silently change the signature to be protected, otherwise users get confused "why this method became protected!?" so they should explicitly know about this.

Next, you'll see another compilation error that says Com.Parse.Signpost.Basic.HttpURLConnectionRequestAdapter.Unwrap() return type is wrong. This is because of generics support limitation of return type variance that you have to fix manually in metadata:
	
	<attr path="/api/package[@name='com.parse.signpost.basic']/class[@name='HttpURLConnectionRequestAdapter']/method[@name='unwrap']" name="return">java.lang.Object</attr>