From ee44bddaf9a158a765a5130230d107240e335356 Mon Sep 17 00:00:00 2001 From: Ivan Kochurkin Date: Wed, 5 Jul 2023 11:39:08 +0200 Subject: [PATCH] [FIR] Add @Supress("unused") to debug and plugin-related declarations --- .../jetbrains/kotlin/fir/resolve/calls/tower/TowerGroup.kt | 2 +- .../kotlin/fir/extensions/predicate/PredicateVisitor.kt | 4 ++++ .../kotlin/fir/tree/generator/util/HierachyGraphGenerator.kt | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/TowerGroup.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/TowerGroup.kt index ed17da7c1c9..3ad648e3977 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/TowerGroup.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/TowerGroup.kt @@ -45,7 +45,7 @@ sealed class TowerGroupKind(val index: Byte) : Comparable { class Local(depth: Int) : WithDepth(6, depth) - class ImplicitOrNonLocal(depth: Int, val kindForDebugSake: String) : WithDepth(7, depth) + class ImplicitOrNonLocal(depth: Int, @Suppress("unused") val kindForDebugSake: String) : WithDepth(7, depth) class ContextReceiverGroup(depth: Int) : WithDepth(8, depth) diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/extensions/predicate/PredicateVisitor.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/extensions/predicate/PredicateVisitor.kt index c99b0462436..afd1475bd2b 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/extensions/predicate/PredicateVisitor.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/extensions/predicate/PredicateVisitor.kt @@ -41,5 +41,9 @@ abstract class PredicateVisitor

, R, D> { } } +// It can be used externally by plugins +@Suppress("unused") typealias DeclarationPredicateVisitor = PredicateVisitor +// It can be used externally by plugins +@Suppress("unused") typealias LookupPredicateVisitor = PredicateVisitor diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/util/HierachyGraphGenerator.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/util/HierachyGraphGenerator.kt index 30d44bdd0cd..2de8101446b 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/util/HierachyGraphGenerator.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/util/HierachyGraphGenerator.kt @@ -9,6 +9,8 @@ import org.jetbrains.kotlin.fir.tree.generator.context.AbstractFirTreeBuilder import org.jetbrains.kotlin.fir.tree.generator.model.Implementation import java.io.File +// It's used to generate a graph in dot format (it's useful for debugging) +@Suppress("unused") fun printHierarchyGraph(builder: AbstractFirTreeBuilder) { fun Implementation.Kind.toColor(): String = when (this) { Implementation.Kind.Interface -> "green"