From aa093ccda34e94c2db75d27950d08360921fb7f8 Mon Sep 17 00:00:00 2001 From: Andrey Shcheglov Date: Thu, 16 Jun 2022 10:18:11 +0300 Subject: [PATCH] Fix the compilation error (Kotlin 1.7+) (#1365) ### What's done: * Non-exhaustive `if` and `when` blocks are no longer allowed when used as expressions (see [KT-44705](https://youtrack.jetbrains.com/issue/KT-44705)). --- .../org/cqfn/diktat/ruleset/rules/chapter1/PackageNaming.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter1/PackageNaming.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter1/PackageNaming.kt index e6d08ba967..998273d77b 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter1/PackageNaming.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter1/PackageNaming.kt @@ -82,6 +82,9 @@ class PackageNaming(configRules: List) : DiktatRule( } ?: if (visitorCounter.incrementAndGet() == 1) { log.error("Not able to find an external configuration for domain" + " name in the common configuration (is it missing in yml config?)") + } else { + @Suppress("RedundantUnitExpression") + Unit } }