diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kotlinSignature/SignaturesPropagationData.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kotlinSignature/SignaturesPropagationData.java index a84e608bd49..0c1889afece 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kotlinSignature/SignaturesPropagationData.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kotlinSignature/SignaturesPropagationData.java @@ -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;