Bug 53299 - Linker fails on any reserved keywords
Summary: Linker fails on any reserved keywords
Status: RESOLVED NORESPONSE
Alias: None
Product: Android
Classification: Xamarin
Component: Linker ()
Version: 7.1 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2017-03-14 07:41 UTC by Daniel
Modified: 2017-08-23 21:16 UTC (History)
3 users (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 NORESPONSE

Description Daniel 2017-03-14 07:41:32 UTC
If you have a class named do, class or any reserved keyword in Java, the linker fails to create the Java interop claas.


This can be easy to reproduce with the following code in Android:

    public class @do : Java.Lang.Object
    {

    }

The compilation fails because the generated do.java class it looks like this:


public class do
	extends java.lang.Object
	implements
		mono.android.IGCUserPeer
{

}

I am using the build tools 7.1 and the latest Xamarin Android stable.
Comment 1 Daniel 2017-03-14 08:41:40 UTC
You may want why you want to do that. However this naming happens after the code obfuscation happens. Since Java does not have support for naming classes like that, I guess a prefix would be enough.
Comment 2 Prashant [MSFT] 2017-07-05 07:05:56 UTC
Thank you for taking the time to submit the bug. Please attach a reproduction (test project) to the bug by starting with a clean Xamarin.Android project and adding just the code necessary to demonstrate the issue.
Comment 3 Cody Beyer (MSFT) 2017-08-23 21:16:21 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!