Community
Participate
Working Groups
The following code fails to compile at line 6 in Eclipse 4.5.1, however it does compile in JDK 1.8.0_60 using javac from the command line: package test; public class Test { public static void main(String[] args) { registerCommand(new Command<>(FooExecutor.class, data -> { //Line 6 })); } static void registerCommand(Command<?> command) { //Implementation irrelevant } } class Command<T extends CommandExecutor> { Command(Class<T> executorType, CommandHandler<T, ? extends CommandData<T>> handler) { } } interface CommandHandler<T extends CommandExecutor, D extends CommandData<T>> { void handle(D data); } interface CommandExecutor { //Implementation irrelevant } interface CommandData<T extends CommandExecutor> { //Implementation irrelevant } class FooExecutor implements CommandExecutor { //Implementation irrelevant } If I change line 6 to be (redundantly) more explicit, it compiles fine in Eclipse as well: registerCommand(new Command<FooExecutor>(FooExecutor.class, (CommandData<FooExecutor> data) -> { })); Surely this is a bug?
I've been experiencing the exact same issue
The following builds all produce different results: 4.5M2 (3 errors) 4.5M3 (2 errors) 4.5M4 (1 errors) The latter behavior can still be seen in HEAD. Similar to bug 483226 we cannot infer a type argument against a wildcard in the target type. (In reply to Ole Sandum from comment #0) > If I change line 6 to be (redundantly) more explicit, it compiles fine in > Eclipse as well: Whether or not that is redundant or mandatory still needs to be seen.
Bulk move out of 4.8
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. If you have further information on the current state of the bug, please add it. 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.