Bug 391869 - [1.8][compiler] Confusing error message for illegal program
Summary: [1.8][compiler] Confusing error message for illegal program
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-14 00:55 EDT by Srikanth Sankaran CLA
Modified: 2014-03-25 23:01 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2012-10-14 00:55:17 EDT
BETA_JAVA8:

The following program triggers three errors:

	- Syntax error on token ".", @ expected after this token
	- Syntax error, insert "SimpleName" to complete ReferenceType
	- Syntax error, insert "VariableDeclarators" to complete 
	 LocalVariableDeclaration

// --------------
public class X {
	public static void main(String[] args) {
		@Marker X.@Marker Y.foo();
	}
	
	static class Y {
		static void foo() {
		}
	}
}


@java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE)
@interface Marker {
}
// ------------------

It would be ideal if we report a clearer message that says "Type annotations
are illegal on type names used to access static members".

However this is very hard to do in the current design of the scanner & parser.
This defect is raised just so this stays on our radar. No plans to fix as of
now. It is also not being marked as a blocker for the JSR308 umbrella
bug.