Bug 12505 - Invalid binding gives bad errorsT
Summary: Invalid binding gives bad errorsT
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.7.x
Hardware: PC Mac OS
: --- normal
Target Milestone: 4.8 (async)
Assignee: Jonathan Pryor
Depends on:
Reported: 2013-05-31 20:01 UTC by Rodrigo Kumpera
Modified: 2013-06-28 12:57 UTC (History)
2 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 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 Rodrigo Kumpera 2013-05-31 20:01:46 UTC
The following class gives me a very unhelpful message:

	public class Parcelable<T> :Java.Lang.Object
		[ExportField("STUFF")] public static void Stuff()



It gives me:


/Users/kumpera/Projects/AndroidGenerics/AndroidGenerics/AndroidGenerics.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_CompileJava target) ->

	obj/Debug/android/src/androidgenerics/Parcelable_1.java(26,27):  javacerror :  '(' expected
	public static void STUFF = Stuff ();

	obj/Debug/android/src/androidgenerics/Parcelable_1.java(26,29): error :  invalid method declaration; return type required
	public static void STUFF = Stuff ();

Furthermore, the Error pad points to the java file which is not helpful at all since it's an implementation detail.
Comment 2 Jonathan Pryor 2013-06-24 17:37:05 UTC
This was fixed in monodroid/7f6dfe69 as part of the fix for Bug #10135, and
will now generate XA4207 ("[ExportField] cannot be used on a generic type") and
(possibly) XA4208, "[ExportField] cannot be used on a method returning void.".
Comment 3 narayanp 2013-06-28 12:57:59 UTC
Today we have checked this issue on following builds :

XS 4.0.9 (build 12)
X.Android 4.7.11002

Now when we run the given code then it gives proper error message as per comment 2. 

Hence closing this issue. Changing its status to verified.