From 7c8e9ac316161c68d29a7e88661edd109abeb661 Mon Sep 17 00:00:00 2001 From: pyos Date: Thu, 3 Nov 2022 15:05:28 +0100 Subject: [PATCH] FIR DFA: remove RealVariableAndType --- .../boundSmartcastsInBranches.dot | 46 +++++++------ .../boundSmartcastsInBranches.fir.txt | 3 +- .../boundSmartcastsInBranches.kt | 3 +- .../fir/resolve/dfa/FirDataFlowAnalyzer.kt | 32 +++------- .../kotlin/fir/resolve/dfa/DfaVariables.kt | 20 ------ .../jetbrains/kotlin/fir/resolve/dfa/Flow.kt | 16 ++--- .../kotlin/fir/resolve/dfa/LogicSystem.kt | 4 +- .../fir/resolve/dfa/PersistentLogicSystem.kt | 64 +++++++------------ .../fir/resolve/dfa/VariableStorageImpl.kt | 3 +- ...ConversionOnArbitraryExpression.fir.ir.txt | 3 +- ...ConversionOnArbitraryExpression.fir.kt.txt | 2 +- .../diagnostics/notLinked/dfa/pos/12.fir.kt | 62 +++++++++--------- .../diagnostics/notLinked/dfa/pos/13.fir.kt | 62 +++++++++--------- 13 files changed, 133 insertions(+), 187 deletions(-) diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot index 03c239a99d7..2e7d30ef9ca 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot @@ -1286,32 +1286,35 @@ digraph boundSmartcastsInBranches_kt { 506 [label="Exit when branch result"]; 507 [label="Exit when"]; } + 508 [label="Access variable R|/b|"]; + 509 [label="Access variable #"]; subgraph cluster_97 { color=blue - 508 [label="Enter when"]; + 510 [label="Enter when"]; subgraph cluster_98 { color=blue - 509 [label="Enter when branch condition "]; - 510 [label="Access variable R|/a|"]; - 511 [label="Const: Null(null)"]; - 512 [label="Equality operator !="]; - 513 [label="Exit when branch condition"]; + 511 [label="Enter when branch condition "]; + 512 [label="Access variable R|/a|"]; + 513 [label="Const: Null(null)"]; + 514 [label="Equality operator !="]; + 515 [label="Exit when branch condition"]; } - 514 [label="Synthetic else branch"]; - 515 [label="Enter when branch result"]; + 516 [label="Synthetic else branch"]; + 517 [label="Enter when branch result"]; subgraph cluster_99 { color=blue - 516 [label="Enter block"]; - 517 [label="Access variable R|/b|"]; - 518 [label="Access variable #"]; - 519 [label="Exit block"]; + 518 [label="Enter block"]; + 519 [label="Access variable R|/b|"]; + 520 [label="Smart cast: R|/b|"]; + 521 [label="Access variable R|kotlin/String.length|"]; + 522 [label="Exit block"]; } - 520 [label="Exit when branch result"]; - 521 [label="Exit when"]; + 523 [label="Exit when branch result"]; + 524 [label="Exit when"]; } - 522 [label="Exit block"]; + 525 [label="Exit block"]; } - 523 [label="Exit function test_9" style="filled" fillcolor=red]; + 526 [label="Exit function test_9" style="filled" fillcolor=red]; } 480 -> {481}; 481 -> {482}; @@ -1346,15 +1349,18 @@ digraph boundSmartcastsInBranches_kt { 510 -> {511}; 511 -> {512}; 512 -> {513}; - 513 -> {515 514}; - 514 -> {521}; - 515 -> {516}; - 516 -> {517}; + 513 -> {514}; + 514 -> {515}; + 515 -> {517 516}; + 516 -> {524}; 517 -> {518}; 518 -> {519}; 519 -> {520}; 520 -> {521}; 521 -> {522}; 522 -> {523}; + 523 -> {524}; + 524 -> {525}; + 525 -> {526}; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt index d3b005cfbf5..835a38e5978 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt @@ -223,9 +223,10 @@ FILE: boundSmartcastsInBranches.kt } } + R|/b|.# when () { !=(R|/a|, Null(null)) -> { - R|/b|.# + R|/b|.R|kotlin/String.length| } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt index 69e62cac433..22feafe6f32 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt @@ -170,7 +170,8 @@ fun test_9() { } else { b = a } + b.length // bad if (a != null) { - b.length // ok + b.length // ok } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt index 48925d5444a..50fa16aabdf 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt @@ -39,7 +39,6 @@ import org.jetbrains.kotlin.fir.visitors.transformSingle import org.jetbrains.kotlin.name.StandardClassIds import org.jetbrains.kotlin.types.ConstantValueKind import org.jetbrains.kotlin.util.OperatorNameConventions -import org.jetbrains.kotlin.utils.addIfNotNull import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull class DataFlowAnalyzerContext( @@ -104,15 +103,13 @@ abstract class FirDataFlowAnalyzer( val symbol = variable.identifier.symbol val index = receiverStack.getReceiverIndex(symbol) ?: return - val info = flow.getTypeStatement(variable) - - val type = if (info == null) { - receiverStack.getOriginalType(index) - } else { - val types = info.exactType.toMutableList().also { - it += receiverStack.getOriginalType(index) - } + val info = flow.getType(variable) + val type = if (info.isNotEmpty()) { + val types = info.toMutableList() + types += receiverStack.getOriginalType(index) context.intersectTypesOrNull(types)!! + } else { + receiverStack.getOriginalType(index) } receiverStack.replaceReceiverType(index, type) } @@ -200,15 +197,8 @@ abstract class FirDataFlowAnalyzer( expression: FirExpression ): Pair>? { val flow = graphBuilder.lastNode.flow - var variable = variableStorage.getRealVariableWithoutUnwrappingAlias(flow, symbol, expression) ?: return null - val stability = variable.stability - val result = mutableListOf() - flow.directAliasMap[variable]?.let { - result.addIfNotNull(it.originalType) - variable = it.variable - } - flow.getTypeStatement(variable)?.exactType?.let { result += it } - return result.takeIf { it.isNotEmpty() }?.let { stability to it } + val variable = variableStorage.getRealVariableWithoutUnwrappingAlias(flow, symbol, expression) ?: return null + return flow.getType(variable)?.takeIf { it.isNotEmpty() }?.let { variable.stability to it.toMutableList() } } fun returnExpressionsOfAnonymousFunction(function: FirAnonymousFunction): Collection { @@ -1251,11 +1241,7 @@ abstract class FirDataFlowAnalyzer( initializerVariable.isStable || (initializerVariable.hasLocalStability && initializer.isAccessToStableVariable()) if (!hasExplicitType && isInitializerStable && (propertyVariable.hasLocalStability || propertyVariable.isStable)) { - logicSystem.addLocalVariableAlias( - flow, propertyVariable, - RealVariableAndType(initializerVariable, initializer.coneType) - ) - // node.flow.addImplication((propertyVariable notEq null) implies (initializerVariable notEq null)) + logicSystem.addLocalVariableAlias(flow, propertyVariable, initializerVariable) } else { logicSystem.replaceVariableFromConditionInStatements(flow, initializerVariable, propertyVariable) } diff --git a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/DfaVariables.kt b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/DfaVariables.kt index a41fa04d9fe..5b688075ba3 100644 --- a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/DfaVariables.kt +++ b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/DfaVariables.kt @@ -76,26 +76,6 @@ class RealVariable( } } -class RealVariableAndType(val variable: RealVariable, val originalType: ConeKotlinType?) { - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (javaClass != other?.javaClass) return false - - other as RealVariableAndType - - if (variable != other.variable) return false - if (originalType != other.originalType) return false - - return true - } - - override fun hashCode(): Int { - var result = variable.hashCode() - result = 31 * result + originalType.hashCode() - return result - } -} - class SyntheticVariable(val fir: FirElement, variableIndexForDebug: Int) : DataFlowVariable(variableIndexForDebug) { override fun equals(other: Any?): Boolean { if (this === other) return true diff --git a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/Flow.kt b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/Flow.kt index 4cef1eceaf6..6f1f5d9a66e 100644 --- a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/Flow.kt +++ b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/Flow.kt @@ -5,17 +5,9 @@ package org.jetbrains.kotlin.fir.resolve.dfa +import org.jetbrains.kotlin.fir.types.ConeKotlinType + abstract class Flow { - abstract fun getTypeStatement(variable: RealVariable): TypeStatement? - abstract fun getImplications(variable: DataFlowVariable): Collection - abstract fun getVariablesInTypeStatements(): Collection - abstract fun removeOperations(variable: DataFlowVariable): Collection - - abstract val directAliasMap: Map - abstract val backwardsAliasMap: Map> - abstract val assignmentIndex: Map -} - -fun Flow.unwrapVariable(variable: RealVariable): RealVariable { - return directAliasMap[variable]?.variable ?: variable + abstract fun unwrapVariable(variable: RealVariable): RealVariable + abstract fun getType(variable: RealVariable): Set? } diff --git a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/LogicSystem.kt b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/LogicSystem.kt index 1b54777a95b..5c33b4e2287 100644 --- a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/LogicSystem.kt +++ b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/LogicSystem.kt @@ -48,7 +48,7 @@ abstract class LogicSystem(protected val context: ConeInferenceCont shouldRemoveSynthetics: Boolean, ): FLOW - abstract fun addLocalVariableAlias(flow: FLOW, alias: RealVariable, underlyingVariable: RealVariableAndType) + abstract fun addLocalVariableAlias(flow: FLOW, alias: RealVariable, underlyingVariable: RealVariable) abstract fun removeLocalVariableAlias(flow: FLOW, alias: RealVariable) abstract fun recordNewAssignment(flow: FLOW, variable: RealVariable, index: Int) @@ -126,7 +126,7 @@ abstract class LogicSystem(protected val context: ConeInferenceCont op: (Collection>) -> MutableSet ): MutableTypeStatement { require(statements.isNotEmpty()) - statements.singleOrNull()?.let { return it as MutableTypeStatement } + statements.singleOrNull()?.let { return it.asMutableStatement() } val variable = statements.first().variable assert(statements.all { it.variable == variable }) val exactType = op.invoke(statements.map { it.exactType }) diff --git a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/PersistentLogicSystem.kt b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/PersistentLogicSystem.kt index d4d442f7eb4..caadeef87ed 100644 --- a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/PersistentLogicSystem.kt +++ b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/PersistentLogicSystem.kt @@ -9,7 +9,6 @@ import com.google.common.collect.ArrayListMultimap import kotlinx.collections.immutable.* import org.jetbrains.kotlin.fir.types.ConeInferenceContext import org.jetbrains.kotlin.fir.types.ConeKotlinType -import org.jetbrains.kotlin.utils.addIfNotNull import java.util.* import kotlin.math.max @@ -51,10 +50,10 @@ class PersistentFlow : Flow { * directAliasMap: { x -> a, y -> a} * backwardsAliasMap: { a -> [x, y] } */ - override var directAliasMap: PersistentMap - override var backwardsAliasMap: PersistentMap> + var directAliasMap: PersistentMap + var backwardsAliasMap: PersistentMap> - override var assignmentIndex: PersistentMap + var assignmentIndex: PersistentMap constructor(previousFlow: PersistentFlow) { this.previousFlow = previousFlow @@ -78,24 +77,22 @@ class PersistentFlow : Flow { assignmentIndex = persistentMapOf() } - override fun getTypeStatement(variable: RealVariable): TypeStatement? { - return approvedTypeStatements[variable] + override fun unwrapVariable(variable: RealVariable): RealVariable { + return directAliasMap[variable] ?: variable } - override fun getImplications(variable: DataFlowVariable): Collection { - return logicStatements[variable] ?: emptyList() - } - - override fun getVariablesInTypeStatements(): Collection { - return approvedTypeStatements.keys - } - - override fun removeOperations(variable: DataFlowVariable): Collection { - return getImplications(variable).also { - if (it.isNotEmpty()) { - logicStatements -= variable - } + fun getTypeStatement(variable: RealVariable): TypeStatement { + val result = MutableTypeStatement(variable) + approvedTypeStatements[variable]?.let { result += it } + val variableUnderAlias = directAliasMap[variable] + if (variableUnderAlias != null) { + approvedTypeStatements[variableUnderAlias]?.let { result += it } } + return result + } + + override fun getType(variable: RealVariable): Set { + return getTypeStatement(variable).exactType } } @@ -110,7 +107,7 @@ abstract class PersistentLogicSystem(context: ConeInferenceContext) : LogicSyste override fun joinFlow(flows: Collection): PersistentFlow { // One input flow executes - one set of statements is true, others might be false. - return foldFlow(flows) { variable -> or(flows.map { it.getApprovedTypeStatements(variable) }).takeIf { it.isNotEmpty } } + return foldFlow(flows) { variable -> or(flows.map { it.getTypeStatement(variable) }).takeIf { it.isNotEmpty } } } override fun unionFlow(flows: Collection): PersistentFlow { @@ -120,7 +117,7 @@ abstract class PersistentLogicSystem(context: ConeInferenceContext) : LogicSyste // happened last (and the flows that don't reassign may or may not have executed after that). return foldFlow(flows) { variable -> or(flows.groupBy { it.assignmentIndex[variable] ?: -1 }.values.map { flowSubset -> - and(flowSubset.map { it.getApprovedTypeStatements(variable) }) + and(flowSubset.map { it.getTypeStatement(variable) }) }) } } @@ -166,16 +163,16 @@ abstract class PersistentLogicSystem(context: ConeInferenceContext) : LogicSyste return commonFlow } - private fun computeCommonAliases(flows: Collection): Map = + private fun computeCommonAliases(flows: Collection): Map = flows.first().directAliasMap.filterTo(mutableMapOf()) { (variable, alias) -> flows.all { it.directAliasMap[variable] == alias } } - override fun addLocalVariableAlias(flow: PersistentFlow, alias: RealVariable, underlyingVariable: RealVariableAndType) { + override fun addLocalVariableAlias(flow: PersistentFlow, alias: RealVariable, underlyingVariable: RealVariable) { removeLocalVariableAlias(flow, alias) flow.directAliasMap = flow.directAliasMap.put(alias, underlyingVariable) flow.backwardsAliasMap = flow.backwardsAliasMap.put( - underlyingVariable.variable, + underlyingVariable, { persistentListOf(alias) }, { variables -> variables + alias } ) @@ -221,7 +218,7 @@ abstract class PersistentLogicSystem(context: ConeInferenceContext) : LogicSyste processApprovedStatements(isDiff = true) } - val original = flow.directAliasMap[alias]?.variable + val original = flow.directAliasMap[alias] if (original != null) { flow.directAliasMap = flow.directAliasMap.remove(alias) val updatedBackwardsAliasList = flow.backwardsAliasMap.getValue(original).remove(alias) @@ -252,23 +249,6 @@ abstract class PersistentLogicSystem(context: ConeInferenceContext) : LogicSyste return statement as T } - - @OptIn(DfaInternals::class) - private fun PersistentFlow.getApprovedTypeStatements(variable: RealVariable): MutableTypeStatement { - var flow = this - val result = MutableTypeStatement(variable) - val variableUnderAlias = directAliasMap[variable] - if (variableUnderAlias == null) { - flow.approvedTypeStatements[variable]?.let { - result += it - } - } else { - result.exactType.addIfNotNull(variableUnderAlias.originalType) - flow.approvedTypeStatements[variableUnderAlias.variable]?.let { result += it } - } - return result - } - override fun addTypeStatement(flow: PersistentFlow, statement: TypeStatement) { if (statement.isEmpty) return with(flow) { diff --git a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/VariableStorageImpl.kt b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/VariableStorageImpl.kt index af95ab577bb..3103fe1b1ee 100644 --- a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/VariableStorageImpl.kt +++ b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/VariableStorageImpl.kt @@ -56,8 +56,7 @@ class VariableStorageImpl(private val session: FirSession) : VariableStorage() { fir: FirElement, stability: PropertyStability ): RealVariable { - val variable = getOrCreateRealVariableWithoutUnwrappingAlias(flow, symbol, fir, stability) - return flow.directAliasMap[variable]?.variable ?: variable + return flow.unwrapVariable(getOrCreateRealVariableWithoutUnwrappingAlias(flow, symbol, fir, stability)) } private fun FirElement.unwrapElement(): FirElement = when (this) { diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.ir.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.ir.txt index fade73106a2..3d974c43b5d 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.ir.txt @@ -265,7 +265,8 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 GET_VAR 'var b: kotlin.Function0 [var] declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: GET_VAR 'var b: kotlin.Function0 [var] declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + sfn: TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=IMPLICIT_CAST typeOperand=kotlin.coroutines.SuspendFunction0 + GET_VAR 'var b: kotlin.Function0 [var] declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null FUN name:testIntersectionVsSuspendConversion visibility:public modality:FINAL (x:T of .testIntersectionVsSuspendConversion) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function0; kotlin.coroutines.SuspendFunction0] reified:false VALUE_PARAMETER name:x index:0 type:T of .testIntersectionVsSuspendConversion diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt index d3aea965056..1624da4a084 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt @@ -181,7 +181,7 @@ fun testSmartCastVsSuspendConversion(a: Function0) { fun testSmartCastOnVarVsSuspendConversion(a: Function0) { var b: Function0 = a b as SuspendFunction0 /*~> Unit */ - useSuspend(sfn = b) + useSuspend(sfn = b /*as SuspendFunction0 */) } fun testIntersectionVsSuspendConversion(x: T) where T : Function0, T : SuspendFunction0 { diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt index cd379d4a540..8090f83bde5 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt @@ -206,20 +206,20 @@ fun T.case_7() { val x = this if (x is Interface1?) { if (x != null) { - x - x.equals(null) + x + x.equals(null) x.propT - x.propAny - x.propNullableT - x.propNullableAny + x.propAny + x.propNullableT + x.propNullableAny x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() - x.itest1() + x.funAny() + x.funNullableT() + x.funNullableAny() + x.itest1() x.apply { - this + this equals(null) propT propAny @@ -230,29 +230,29 @@ fun T.case_7() { funNullableT() funNullableAny() itest1() - this.equals(null) - this.propT - this.propAny - this.propNullableT - this.propNullableAny - this.funT() - this.funAny() - this.funNullableT() - this.funNullableAny() - this.itest1() + this.equals(null) + this.propT + this.propAny + this.propNullableT + this.propNullableAny + this.funT() + this.funAny() + this.funNullableT() + this.funNullableAny() + this.itest1() } x.also { - it - it.itest1() - it.equals(null) - it.propT - it.propAny - it.propNullableT - it.propNullableAny - it.funT() - it.funAny() - it.funNullableT() - it.funNullableAny() + it + it.itest1() + it.equals(null) + it.propT + it.propAny + it.propNullableT + it.propNullableAny + it.funT() + it.funAny() + it.funNullableT() + it.funNullableAny() } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt index b56100b5cf8..dfe9c176bb4 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt @@ -258,20 +258,20 @@ fun case_7(y: T) { val x = y if (x is Interface1?) { if (x != null) { - x - x.equals(null) + x + x.equals(null) x.propT - x.propAny - x.propNullableT - x.propNullableAny + x.propAny + x.propNullableT + x.propNullableAny x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() - x.itest() + x.funAny() + x.funNullableT() + x.funNullableAny() + x.itest() x.apply { - this + this equals(null) propT propAny @@ -282,29 +282,29 @@ fun case_7(y: T) { funNullableT() funNullableAny() itest() - this.equals(null) - this.propT - this.propAny - this.propNullableT - this.propNullableAny - this.funT() - this.funAny() - this.funNullableT() - this.funNullableAny() - this.itest() + this.equals(null) + this.propT + this.propAny + this.propNullableT + this.propNullableAny + this.funT() + this.funAny() + this.funNullableT() + this.funNullableAny() + this.itest() } x.also { - it - it.itest() - it.equals(null) - it.propT - it.propAny - it.propNullableT - it.propNullableAny - it.funT() - it.funAny() - it.funNullableT() - it.funNullableAny() + it + it.itest() + it.equals(null) + it.propT + it.propAny + it.propNullableT + it.propNullableAny + it.funT() + it.funAny() + it.funNullableT() + it.funNullableAny() } } }