Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 402618 - [1.8][compiler] Compiler fails to resolve type annotations on method/constructor references
Summary: [1.8][compiler] Compiler fails to resolve type annotations on method/construc...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 287648
  Show dependency tree
 
Reported: 2013-03-07 03:50 EST by Srikanth Sankaran CLA
Modified: 2013-03-07 07:12 EST (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 2013-03-07 03:50:21 EST
BETA_JAVA8:

The following program should fail to compile, but compiles successfully:

// ----
interface I {
	void foo(X x);
}

public class X {
	void foo() {
	}
	
	public void main(String[] args) {
		I i = @Marker X::foo;
	}
}


The compiler silently acepts the undefined annotation Marker
Comment 1 Srikanth Sankaran CLA 2013-03-07 04:21:34 EST
Another example that shows type annotations in all possible places
in a method/constructor reference:

// -----------------
import java.util.List;
interface I {
	void foo(List<String> l);
}

public class X {
	public void main(String[] args) {
		I i = @Readonly List<@English String>::<@NonNegative Integer>size;
	}
}

This program should trigger 3 errors, but only triggers two with eclipse.