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;
|
||||
DeclarationDescriptor superFun = trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, superDeclaration);
|
||||
if (superFun instanceof FunctionDescriptor) {
|
||||
superFunctions.add(((FunctionDescriptor) superFun));
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (superFun == null) {
|
||||
reportCantFindSuperFunction(method);
|
||||
continue;
|
||||
}
|
||||
|
||||
assert superFun instanceof FunctionDescriptor : superFun.getClass().getName();
|
||||
superFunctions.add((FunctionDescriptor) superFun);
|
||||
}
|
||||
|
||||
// sorting for diagnostic stability
|
||||
@@ -576,6 +565,22 @@ public class SignaturesPropagationData {
|
||||
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 {
|
||||
public final JetType parameterType;
|
||||
public final boolean isVararg;
|
||||
|
||||
Reference in New Issue
Block a user