Minor. Simplified code.
This commit is contained in:
+22
-17
@@ -216,24 +216,13 @@ public class SignaturesPropagationData {
|
|||||||
|
|
||||||
PsiElement superDeclaration = superMethod instanceof JetClsMethod ? ((JetClsMethod) superMethod).getOrigin() : superMethod;
|
PsiElement superDeclaration = superMethod instanceof JetClsMethod ? ((JetClsMethod) superMethod).getOrigin() : superMethod;
|
||||||
DeclarationDescriptor superFun = trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, superDeclaration);
|
DeclarationDescriptor superFun = trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, superDeclaration);
|
||||||
if (superFun instanceof FunctionDescriptor) {
|
if (superFun == null) {
|
||||||
superFunctions.add(((FunctionDescriptor) superFun));
|
reportCantFindSuperFunction(method);
|
||||||
}
|
continue;
|
||||||
else {
|
|
||||||
String errorMessage = "Can't find super function for " + method.getPsiMethod() +
|
|
||||||
" defined in " + method.getPsiMethod().getContainingClass();
|
|
||||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
|
||||||
throw new IllegalStateException(errorMessage);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (SystemInfo.isMac) {
|
|
||||||
LOG.error("Remove duplicates from your JDK definition\n" + errorMessage);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LOG.error(errorMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert superFun instanceof FunctionDescriptor : superFun.getClass().getName();
|
||||||
|
superFunctions.add((FunctionDescriptor) superFun);
|
||||||
}
|
}
|
||||||
|
|
||||||
// sorting for diagnostic stability
|
// sorting for diagnostic stability
|
||||||
@@ -576,6 +565,22 @@ public class SignaturesPropagationData {
|
|||||||
return builtIns.isArray(type) || builtIns.isPrimitiveArray(type);
|
return builtIns.isArray(type) || builtIns.isPrimitiveArray(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void reportCantFindSuperFunction(PsiMethodWrapper method) {
|
||||||
|
String errorMessage = "Can't find super function for " + method.getPsiMethod() +
|
||||||
|
" defined in " + method.getPsiMethod().getContainingClass();
|
||||||
|
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||||
|
throw new IllegalStateException(errorMessage);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (SystemInfo.isMac) {
|
||||||
|
LOG.error("Remove duplicates from your JDK definition\n" + errorMessage);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LOG.error(errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static class VarargCheckResult {
|
private static class VarargCheckResult {
|
||||||
public final JetType parameterType;
|
public final JetType parameterType;
|
||||||
public final boolean isVararg;
|
public final boolean isVararg;
|
||||||
|
|||||||
Reference in New Issue
Block a user