mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 18:50:54 +07:00
incorporation: deal with PsiType.NULL (IDEA-147529)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import java.io.Serializable;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
class Test {
|
||||
|
||||
interface HasCode<T extends Serializable> {
|
||||
|
||||
static <U extends Serializable, T extends Enum<T> & HasCode<U>> T fromCode(U code, Class<T> classEnum) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
enum EnumRaw implements HasCode{
|
||||
RAW_VALUE1;
|
||||
}
|
||||
|
||||
public static <T, U extends Serializable, R> R checkExpected(BiFunction<T, U, R> funct, T param, U secondParam, R expectedResult){
|
||||
R result = funct.apply(param, secondParam);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
checkExpected(HasCode::fromCode, "RAW_VALUE2", EnumRaw.class, EnumRaw.RAW_VALUE1);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user