Replace incorrect assertion with explicit check (EA-93946 - assert: UnusedSymbolInspection.hasNonTrivialUsages)

This commit is contained in:
Dmitry Jemerov
2017-01-26 20:35:39 +01:00
parent 7236aa45f2
commit 6cbb2a4491
@@ -217,7 +217,7 @@ class UnusedSymbolInspection : AbstractKotlinInspection() {
var zeroOccurrences = true
for (name in listOf(declaration.name) + declaration.getAccessorNames() + declaration.getClassNameForCompanionObject().singletonOrEmptyList()) {
assert(name != null) { "Name is null for " + declaration.getElementTextWithContext() }
if (name == null) continue
when (psiSearchHelper.isCheapEnoughToSearch(name!!, useScope, null, null)) {
ZERO_OCCURRENCES -> {} // go on, check other names
FEW_OCCURRENCES -> zeroOccurrences = false