| Summary: | The JDT compiler allows different return types for the same method name and parameters | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Christian Schwarz <chriss.dev> | ||||
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | stephan.herrmann | ||||
| Version: | 4.4.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. For posterity: the only weirdness here is, that at compliance 1.6 all name clashes are reported as warnings only, all other compliance levels (older as well as newer) correctly report errors. This detail concerning compliance 1.6 is not a priority in JDT development. |
Created attachment 263631 [details] The java project to reproduce this bug. The following test case compiles fine JDT core version 3.10.2.v20150220-1634 but it should not complile. public class Test { public static <T> T foo(Matcher<T> p){ return null; } public static long foo(Matcher<Long> p){ return 0; } public static int foo(Matcher<Integer> p){ return 0; } } To reproduce it do the following: - create a new java project with execution enviroment J2SE-1.5 - go to the project properies and set the compiler compliance level to "1.6" - now the above code compiles The installed JRE was to one of JDK1.8.0_25