mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
functional type erasure: check if resulted type functional (IDEA-142341)
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
interface Functional {
|
||||
void a(String s);
|
||||
}
|
||||
|
||||
interface NonFunctional {
|
||||
void b(String s);
|
||||
void c();
|
||||
}
|
||||
|
||||
interface P<<warning descr="Type parameter 'T' is never used">T</warning>> {
|
||||
void subscribe(Functional f);
|
||||
void subscribe(NonFunctional nf);
|
||||
}
|
||||
|
||||
class Test {
|
||||
void foo(P p) {
|
||||
p.subscribe(s -> {});
|
||||
}
|
||||
}
|
||||
|
||||
interface FunctionalExact {
|
||||
void a();
|
||||
}
|
||||
|
||||
interface NonFunctionalExact {
|
||||
void b();
|
||||
void c();
|
||||
}
|
||||
|
||||
interface PExact<<warning descr="Type parameter 'T' is never used">T</warning>> {
|
||||
void subscribe(FunctionalExact f);
|
||||
void subscribe(NonFunctionalExact nf);
|
||||
}
|
||||
|
||||
class TestExact {
|
||||
void foo(PExact p) {
|
||||
p.subscribe(() -> {});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user