diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt index da9c353612c..41d79009904 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt @@ -123,6 +123,12 @@ public class UnusedSymbolInspection : AbstractKotlinInspection() { } private fun isEntryPoint(declaration: JetNamedDeclaration): Boolean { + // TODO Workaround for EA-64030 - IOE: PsiJavaParserFacadeImpl.createAnnotationFromText + // This should be fixed on IDEA side: ClsAnnotation should not throw exceptions when annotation class has Java keyword + if (declaration is JetNamedFunction) { + if (declaration.getAnnotationEntries().any { it.getTypeReference().getText().endsWith("native") }) return false + } + val lightElement: PsiElement? = when (declaration) { is JetClassOrObject -> declaration.toLightClass() is JetNamedFunction -> LightClassUtil.getLightClassMethod(declaration) diff --git a/idea/testData/inspections/unusedSymbol/function/inspectionData/expected.xml b/idea/testData/inspections/unusedSymbol/function/inspectionData/expected.xml index 94b24f0cec5..311ce44858a 100644 --- a/idea/testData/inspections/unusedSymbol/function/inspectionData/expected.xml +++ b/idea/testData/inspections/unusedSymbol/function/inspectionData/expected.xml @@ -51,4 +51,13 @@ Unused Symbol Function 'unused' is never used + + + withNativeAnnotation.kt + 3 + light_idea_test_case + + Unused Symbol + Function 'withNativeAnnotation' is never used + diff --git a/idea/testData/inspections/unusedSymbol/function/withNativeAnnotation.kt b/idea/testData/inspections/unusedSymbol/function/withNativeAnnotation.kt new file mode 100644 index 00000000000..c5b5f5cf07d --- /dev/null +++ b/idea/testData/inspections/unusedSymbol/function/withNativeAnnotation.kt @@ -0,0 +1,5 @@ +annotation class native + +native fun withNativeAnnotation() { + +} \ No newline at end of file