From 2fcee37b585cabfe33c9c8b6781c404713ec02e2 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Wed, 18 Mar 2015 15:07:32 +0300 Subject: [PATCH] Temporarily disabled "Unused symbol" for companion objects. --- .../kotlin/idea/inspections/UnusedSymbolInspection.kt | 3 +++ .../unusedSymbol/object/inspectionData/expected.xml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt index 6b3901f7fa6..4c249f2dab6 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt @@ -107,6 +107,9 @@ public class UnusedSymbolInspection : AbstractKotlinInspection() { if (declaration is JetParameter && (declaration.getParent()?.getParent() !is JetClass || !declaration.hasValOrVarNode())) return if (declaration is JetNamedFunction && isConventionalName(declaration)) return + // TODO companion objects are temporarily disabled + if (isCompanionObject) return + // More expensive, resolve-based checks if (isEntryPoint(declaration)) return // properties can be referred by component1/component2, which is too expensive to search, don't mark them as unused diff --git a/idea/testData/inspections/unusedSymbol/object/inspectionData/expected.xml b/idea/testData/inspections/unusedSymbol/object/inspectionData/expected.xml index 46f1f56dd7f..2702ba8ef35 100644 --- a/idea/testData/inspections/unusedSymbol/object/inspectionData/expected.xml +++ b/idea/testData/inspections/unusedSymbol/object/inspectionData/expected.xml @@ -32,6 +32,7 @@ Object 'A' is never used +