mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-07-27 15:48:27 +07:00
fin functional expressions of SAM interfaces related to the given one
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
interface DumbAware {}
|
||||
interface MyRunnable {
|
||||
String foo();
|
||||
}
|
||||
interface DumbAwareRunnable extends MyRunnable, DumbAware {}
|
||||
interface DumbAwareRunnable2 extends DumbAwareRunnable {}
|
||||
|
||||
interface DumbAwareFunction extends DumbAware {
|
||||
Object f(Object o);
|
||||
}
|
||||
|
||||
class Foo {
|
||||
<T extends DumbAware> void foo(T r, Class<T> c) {}
|
||||
void bar(DumbAwareRunnable r) {}
|
||||
void bar2(DumbAwareRunnable2 r) {}
|
||||
|
||||
{
|
||||
DumbAwareRunnable var1 = () -> "var1";
|
||||
DumbAwareRunnable2 var2 = () -> "var2";
|
||||
DumbAwareFunction var3 = a -> "var3";
|
||||
|
||||
foo(() -> "c1", DumbAwareRunnable2.class);
|
||||
bar(() -> "c2");
|
||||
bar2(() -> "c3");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user