mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
do not apply substitutor twice (IDEA-101752)
This commit is contained in:
@@ -29,9 +29,18 @@ import java.util.List;
|
||||
public abstract class HierarchicalMethodSignature extends MethodSignatureBackedByPsiMethod {
|
||||
public HierarchicalMethodSignature(@NotNull MethodSignatureBackedByPsiMethod signature) {
|
||||
super(signature.getMethod(), signature.getSubstitutor(), signature.isRaw(),
|
||||
signature.getParameterTypes(), signature.getTypeParameters());
|
||||
getParameterTypes(signature.getMethod()), signature.getTypeParameters());
|
||||
}
|
||||
|
||||
private static PsiType[] getParameterTypes(PsiMethod method) {
|
||||
final PsiParameter[] parameters = method.getParameterList().getParameters();
|
||||
final PsiType[] paramTypes = new PsiType[parameters.length];
|
||||
for (int i = 0; i < paramTypes.length; i++) {
|
||||
paramTypes[i] = parameters[i].getType();
|
||||
}
|
||||
return paramTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of super method signatures for the specified signature.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
public interface Iso<T, R> {
|
||||
T deply(R r);
|
||||
|
||||
default Iso<R, T> inverse() {
|
||||
final Iso<T, R> z = this;
|
||||
return new Iso<R, T>() {
|
||||
@Override
|
||||
public R deply(T t) {
|
||||
throw null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static <T, R> Iso<R, T> inverse(Iso<T, R> z) {
|
||||
return new Iso<R, T>() {
|
||||
@Override
|
||||
public R deply(T t) {
|
||||
throw null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ public class Interface8MethodsHighlightingTest extends LightDaemonAnalyzerTestCa
|
||||
public void testExtensionMethods() { doTest(false, false); }
|
||||
public void testInheritDefaultMethodInInterface() { doTest(false, false); }
|
||||
public void testStaticMethodsInFunctionalInterface() { doTest(false, false); }
|
||||
public void testCyclicSubstitutor() { doTest(false, false); }
|
||||
|
||||
public void testExtensionMethodSyntax() {
|
||||
enableInspectionTools(DeprecatedDefenderSyntaxInspection.class);
|
||||
|
||||
Reference in New Issue
Block a user