question about enhanced type-inference
Liam Miller-Cushon
cushon at google.com
Tue Nov 19 10:16:24 PST 2013
I have been experimenting with migrating some code to compile with javac
8's new graph inference algorithm. This has generally gone quite smoothly,
but I ran into the following case where inference succeeds with legacy
inference and fails with graph inference.
Is this a known limitation of the new inference algorithm?
Here's the code:
===
interface Task<E extends Exception> {}
class Comparator<T> {}
class CustomException extends Exception {}
class TaskQueue<E extends Exception, T extends Task<E>> {}
abstract class Test {
abstract <E extends Exception, T extends Task<E>>
TaskQueue<E, T> create(Comparator<? super T> comparator);
void f(Comparator<Task<CustomException>> comp) {
TaskQueue<CustomException, Task<CustomException>> queue = create(comp);
}
}
===
More information about the lambda-dev
mailing list