From 71d8b41beff1368a3d03fa6b12e72a41684a8903 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 24 Jan 2020 13:55:12 +0300 Subject: [PATCH] [FIR] Remove unused utilities --- .../tree/src/org/jetbrains/kotlin/fir/Utils.kt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/Utils.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/Utils.kt index 64cb1333ecc..6bf40f6c321 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/Utils.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/Utils.kt @@ -15,29 +15,12 @@ import org.jetbrains.kotlin.fir.declarations.impl.FirModifiableClass import org.jetbrains.kotlin.fir.declarations.modality import org.jetbrains.kotlin.fir.expressions.FirBlock import org.jetbrains.kotlin.fir.expressions.FirExpression -import org.jetbrains.kotlin.fir.expressions.FirExpressionWithSmartcast -import org.jetbrains.kotlin.fir.expressions.FirWhenSubjectExpression fun ModuleInfo.dependenciesWithoutSelf(): Sequence = dependencies().asSequence().filter { it != this } // TODO: rewrite fun FirBlock.returnExpressions(): List = listOfNotNull(statements.lastOrNull() as? FirExpression) -fun FirElement.unwrapWhenSubjectExpression(): FirElement = if (this is FirWhenSubjectExpression) { - val whenExpression = whenSubject.whenExpression - whenExpression.subjectVariable - ?: whenExpression.subject - ?: throw IllegalStateException("Subject or subject variable must be not null") -} else { - this -} - -tailrec fun FirElement.unwrapSmartcast(): FirElement = if (this is FirExpressionWithSmartcast) { - originalExpression.unwrapSmartcast() -} else { - this -} - private val PUBLIC_METHOD_NAMES_IN_OBJECT = setOf("equals", "hashCode", "getClass", "wait", "notify", "notifyAll", "toString") fun FirModifiableClass.calculateSAM() {