mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-03 15:50:52 +07:00
lambda: check interface functional
This commit is contained in:
@@ -0,0 +1 @@
|
||||
abstract class Foo { public abstract void run(); }
|
||||
@@ -0,0 +1,4 @@
|
||||
interface Foo {
|
||||
int m();
|
||||
Object clone();
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
interface Foo { <T> T execute(Action<T> a); }
|
||||
interface Action<A>{}
|
||||
// Functional
|
||||
@@ -0,0 +1,3 @@
|
||||
interface Bar { boolean equals(Object obj); }
|
||||
|
||||
interface Foo extends Bar { int compare(String o1, String o2); }
|
||||
@@ -0,0 +1,4 @@
|
||||
interface Foo<T> {
|
||||
boolean equals(Object obj);
|
||||
int compare(T o1, T o2);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
interface Foo { boolean equals(Object obj); }
|
||||
@@ -0,0 +1 @@
|
||||
interface Foo { void run(); }
|
||||
@@ -0,0 +1,4 @@
|
||||
interface X { int m(Iterable<String> arg); }
|
||||
interface Y { int m(Iterable<Integer> arg); }
|
||||
interface Foo extends X, Y {}
|
||||
// Not functional: No method has a subsignature of all abstract methods
|
||||
@@ -0,0 +1,4 @@
|
||||
interface X { int m(Iterable<String> arg, Class c); }
|
||||
interface Y { int m(Iterable arg, Class<?> c); }
|
||||
interface Foo extends X, Y {}
|
||||
// Not functional: No method has a subsignature of all abstract methods
|
||||
@@ -0,0 +1,4 @@
|
||||
import java.util.*;
|
||||
interface X { int m(Iterable<String> arg); }
|
||||
interface Y { int m(Iterable<String> arg); }
|
||||
interface Foo extends X, Y {}
|
||||
@@ -0,0 +1,5 @@
|
||||
interface Action<A>{}
|
||||
interface X { <T> T execute(Action<T> a); }
|
||||
interface Y { <S> S execute(Action<S> a); }
|
||||
interface Foo extends X, Y {}
|
||||
// Functional: signatures are "the same"
|
||||
@@ -0,0 +1,5 @@
|
||||
interface Foo1<T, N extends Number> {
|
||||
void m(T arg);
|
||||
void m(N arg);
|
||||
}
|
||||
interface Foo extends Foo1<Integer, Integer> {}
|
||||
@@ -0,0 +1,4 @@
|
||||
import java.util.*;
|
||||
interface X { Iterable m(Iterable<String> arg); }
|
||||
interface Y { Iterable<String> m(Iterable arg); }
|
||||
interface Foo extends X, Y {}
|
||||
Reference in New Issue
Block a user