most specific check for proper functional types fixed

This commit is contained in:
Anna.Kozlova
2016-03-21 18:56:05 +01:00
parent aabf15c80f
commit c5c96608b7
3 changed files with 31 additions and 14 deletions

View File

@@ -0,0 +1,19 @@
class Main {
void perform(Runnable r) {
System.out.println(r);
}
<T extends Throwable> void perform(TRunnable<T> r) {
System.out.println(r);
}
interface TRunnable<T extends Throwable> {
void run() throws T;
}
{
<error descr="Ambiguous method call: both 'Main.perform(Runnable)' and 'Main.perform(TRunnable<RuntimeException>)' match">perform</error>(() -> {});
}
}