From 40b8b682f905c9d57904882008577d37c4524e54 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 9 May 2023 14:22:33 +0300 Subject: [PATCH] [FIR] Don't save DFA implications for unstable local vars ^KT-57502 Fixed --- ...CompilerTestFE10TestdataTestGenerated.java | 6 + ...cCompilerTestFirTestdataTestGenerated.java | 6 + ...sticCompilerFE10TestDataTestGenerated.java | 6 + ...osticCompilerFirTestDataTestGenerated.java | 6 + .../LazyBodyIsNotTouchedTestGenerated.java | 5 + .../smartcastStoredInLocalVar.fir.txt | 122 ++++++++++++++++++ .../variables/smartcastStoredInLocalVar.kt | 84 ++++++++++++ .../FirLightTreeDiagnosticsTestGenerated.java | 6 + ...eeOldFrontendDiagnosticsTestGenerated.java | 6 + .../FirPsiDiagnosticTestGenerated.java | 6 + ...siOldFrontendDiagnosticsTestGenerated.java | 6 + .../fir/resolve/dfa/FirDataFlowAnalyzer.kt | 15 +-- .../fir/resolve/dfa/VariableStorageImpl.kt | 6 +- .../variables/localDelegatedProperty.kt | 13 ++ .../varnotnull/boundInitializer.fir.kt | 2 +- .../test/runners/DiagnosticTestGenerated.java | 6 + 16 files changed, 289 insertions(+), 12 deletions(-) create mode 100644 compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.fir.txt create mode 100644 compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.kt create mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/localDelegatedProperty.kt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index 666d44bce4e..c23cfc2c4e4 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -31287,6 +31287,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.kt"); } + @Test + @TestMetadata("localDelegatedProperty.kt") + public void testLocalDelegatedProperty() throws Exception { + runTest("compiler/testData/diagnostics/tests/smartCasts/variables/localDelegatedProperty.kt"); + } + @Test @TestMetadata("objectMembers.kt") public void testObjectMembers() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFirTestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFirTestdataTestGenerated.java index 2db4988c98f..ccf75fa6cc3 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFirTestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFirTestdataTestGenerated.java @@ -4771,6 +4771,12 @@ public class DiagnosticCompilerTestFirTestdataTestGenerated extends AbstractDiag public void testSmartcastAfterReassignment() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt"); } + + @Test + @TestMetadata("smartcastStoredInLocalVar.kt") + public void testSmartcastStoredInLocalVar() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.kt"); + } } } diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index ce5e02daa8b..d9fa0738e8d 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -31287,6 +31287,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.kt"); } + @Test + @TestMetadata("localDelegatedProperty.kt") + public void testLocalDelegatedProperty() throws Exception { + runTest("compiler/testData/diagnostics/tests/smartCasts/variables/localDelegatedProperty.kt"); + } + @Test @TestMetadata("objectMembers.kt") public void testObjectMembers() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated.java index dded6fdef43..870db1a3369 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated.java @@ -4771,6 +4771,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated public void testSmartcastAfterReassignment() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt"); } + + @Test + @TestMetadata("smartcastStoredInLocalVar.kt") + public void testSmartcastStoredInLocalVar() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.kt"); + } } } diff --git a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTestGenerated.java b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTestGenerated.java index 168e80f3e51..9f51ac83826 100644 --- a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTestGenerated.java +++ b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTestGenerated.java @@ -4230,6 +4230,11 @@ public class LazyBodyIsNotTouchedTestGenerated extends AbstractLazyBodyIsNotTouc public void testSmartcastAfterReassignment() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt"); } + + @TestMetadata("smartcastStoredInLocalVar.kt") + public void testSmartcastStoredInLocalVar() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.kt"); + } } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.fir.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.fir.txt new file mode 100644 index 00000000000..3573ad2bdf8 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.fir.txt @@ -0,0 +1,122 @@ +FILE: smartcastStoredInLocalVar.kt + public final fun nonInPlaceRun(block: R|() -> kotlin/Unit|): R|kotlin/Unit| { + } + public final fun test_0(a: R|kotlin/Any|): R|kotlin/Unit| { + lvar b: R|kotlin/Boolean| = (R|/a| is R|kotlin/String|) + when () { + R|/b| -> { + R|/a|.# + } + } + + R|/nonInPlaceRun|( = nonInPlaceRun@fun (): R|kotlin/Unit| { + when () { + R|/b| -> { + R|/a|.# + } + } + + } + ) + when () { + R|/b| -> { + R|/a|.# + } + } + + } + public final fun test_1(a: R|kotlin/Any|): R|kotlin/Unit| { + lvar b: R|kotlin/Boolean| = (R|/a| is R|kotlin/String|) + when () { + R|/b| -> { + R|/a|.# + } + } + + R|/nonInPlaceRun|( = nonInPlaceRun@fun (): R|kotlin/Unit| { + when () { + R|/b| -> { + R|/a|.# + } + } + + } + ) + R|/b| = Boolean(true) + } + public final fun test_2(a: R|kotlin/Any|): R|kotlin/Unit| { + lvar b: R|kotlin/Boolean| = (R|/a| is R|kotlin/String|) + when () { + R|/b| -> { + R|/a|.# + } + } + + R|/nonInPlaceRun|( = nonInPlaceRun@fun (): R|kotlin/Unit| { + R|/b| = Boolean(true) + } + ) + when () { + R|/b| -> { + R|/a|.# + } + } + + } + public final fun test_3(a: R|kotlin/Any|): R|kotlin/Unit| { + lvar b: R|kotlin/Boolean| = (R|/a| is R|kotlin/String|) + when () { + R|/b| -> { + R|/a|.# + } + } + + R|kotlin/run|( = run@fun (): R|kotlin/Unit| { + when () { + R|/b| -> { + R|/a|.# + } + } + + } + ) + R|/b| = Boolean(true) + } + public final fun test_4(a: R|kotlin/Any|): R|kotlin/Unit| { + lvar b: R|kotlin/Boolean| = (R|/a| is R|kotlin/String|) + when () { + R|/b| -> { + R|/a|.# + } + } + + R|kotlin/run|( = run@fun (): R|kotlin/Unit| { + R|/b| = Boolean(true) + } + ) + when () { + R|/b| -> { + R|/a|.# + } + } + + } + public final fun test_5(a: R|kotlin/Any|): R|kotlin/Unit| { + lvar b: R|kotlin/Boolean| = (R|/a| is R|kotlin/String|) + while(R|/b|) { + when () { + R|/b| -> { + R|/a|.# + } + } + + R|/b| = (R|/a| is R|kotlin/String|) + } + + when () { + R|/b| -> { + R|/a|.# + } + } + + } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.kt new file mode 100644 index 00000000000..b59d9c1c481 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.kt @@ -0,0 +1,84 @@ +// WITH_STDLIB +// ISSUE: KT-58604 + +fun nonInPlaceRun(block: () -> Unit) {} + +fun test_0(a: Any) { + var b = a is String + if (b) { + a.length // can be ok + } + nonInPlaceRun { + if (b) { + a.length // can be ok + } + } + if (b) { + a.length // can be ok + } +} + +fun test_1(a: Any) { + var b = a is String + if (b) { + a.length // can be ok + } + nonInPlaceRun { + if (b) { + a.length // not ok + } + } + b = true +} + +fun test_2(a: Any) { + var b = a is String + if (b) { + a.length // can be ok + } + nonInPlaceRun { + b = true + } + if (b) { + a.length // not ok + } +} + +fun test_3(a: Any) { + var b = a is String + if (b) { + a.length // // can be ok + } + run { + if (b) { + a.length // // can be ok + } + } + b = true +} + +fun test_4(a: Any) { + var b = a is String + if (b) { + a.length // // can be ok + } + run { + b = true + } + if (b) { + a.length // not ok + } +} + +fun test_5(a: Any) { + var b = a is String + while (b) { + if (b) { + a.length // not ok + } + b = a is String + } + if (b) { + a.length // // can be ok + } +} diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeDiagnosticsTestGenerated.java index 57e0f8c6786..4039cfdef55 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeDiagnosticsTestGenerated.java @@ -4771,6 +4771,12 @@ public class FirLightTreeDiagnosticsTestGenerated extends AbstractFirLightTreeDi public void testSmartcastAfterReassignment() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt"); } + + @Test + @TestMetadata("smartcastStoredInLocalVar.kt") + public void testSmartcastStoredInLocalVar() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.kt"); + } } } diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 3a290a99647..2c5dbb458cb 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -31287,6 +31287,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.kt"); } + @Test + @TestMetadata("localDelegatedProperty.kt") + public void testLocalDelegatedProperty() throws Exception { + runTest("compiler/testData/diagnostics/tests/smartCasts/variables/localDelegatedProperty.kt"); + } + @Test @TestMetadata("objectMembers.kt") public void testObjectMembers() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiDiagnosticTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiDiagnosticTestGenerated.java index b577393b34b..9e682ba97ea 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiDiagnosticTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiDiagnosticTestGenerated.java @@ -4771,6 +4771,12 @@ public class FirPsiDiagnosticTestGenerated extends AbstractFirPsiDiagnosticTest public void testSmartcastAfterReassignment() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt"); } + + @Test + @TestMetadata("smartcastStoredInLocalVar.kt") + public void testSmartcastStoredInLocalVar() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastStoredInLocalVar.kt"); + } } } diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 18ed0b3347c..71fdae94b41 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -31383,6 +31383,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.kt"); } + @Test + @TestMetadata("localDelegatedProperty.kt") + public void testLocalDelegatedProperty() throws Exception { + runTest("compiler/testData/diagnostics/tests/smartCasts/variables/localDelegatedProperty.kt"); + } + @Test @TestMetadata("objectMembers.kt") public void testObjectMembers() throws Exception { 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 e542885d876..e8c51aeadf8 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 @@ -919,11 +919,8 @@ abstract class FirDataFlowAnalyzer( assignmentLhs: FirExpression?, hasExplicitType: Boolean, ) { - val propertyVariable = variableStorage.getOrCreateRealVariableWithoutUnwrappingAlias( - flow, - property.symbol, - assignmentLhs ?: property, - if (property.isVal) PropertyStability.STABLE_VALUE else PropertyStability.LOCAL_VAR + val propertyVariable = variableStorage.getOrCreateRealVariableWithoutUnwrappingAliasForPropertyInitialization( + flow, property.symbol, assignmentLhs ?: property ) val isAssignment = assignmentLhs != null if (isAssignment) { @@ -932,8 +929,7 @@ abstract class FirDataFlowAnalyzer( val initializerVariable = variableStorage.getOrCreateIfReal(flow, initializer) if (initializerVariable is RealVariable) { - val isInitializerStable = - initializerVariable.isStable || (initializerVariable.hasLocalStability && !isAccessToUnstableLocalVariable(initializer)) + val isInitializerStable = initializerVariable.isStableOrLocalStableAccess(initializer) if (!hasExplicitType && isInitializerStable && (propertyVariable.hasLocalStability || propertyVariable.isStable)) { // val a = ... // val b = a @@ -945,7 +941,7 @@ abstract class FirDataFlowAnalyzer( // if (b != null) { /* a != null, but a.x could have changed */ } logicSystem.translateVariableFromConditionInStatements(flow, initializerVariable, propertyVariable) } - } else if (initializerVariable != null) { + } else if (initializerVariable != null && propertyVariable.isStable) { // val b = x is String // if (b) { /* x is String */ } logicSystem.translateVariableFromConditionInStatements(flow, initializerVariable, propertyVariable) @@ -961,6 +957,9 @@ abstract class FirDataFlowAnalyzer( private val RealVariable.isStable get() = stability == PropertyStability.STABLE_VALUE private val RealVariable.hasLocalStability get() = stability == PropertyStability.LOCAL_VAR + private fun RealVariable.isStableOrLocalStableAccess(access: FirExpression): Boolean { + return isStable || (hasLocalStability && !isAccessToUnstableLocalVariable(access)) + } fun exitThrowExceptionNode(throwExpression: FirThrowExpression) { graphBuilder.exitThrowExceptionNode(throwExpression).mergeIncomingFlow() 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 62f7113ccf0..7ac652bda0d 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 @@ -25,7 +25,6 @@ import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.ConeClassLikeType import org.jetbrains.kotlin.fir.types.coneTypeSafe -import org.jetbrains.kotlin.fir.expressions.explicitReceiver @OptIn(DfaInternals::class) class VariableStorageImpl(private val session: FirSession) : VariableStorage() { @@ -38,14 +37,15 @@ class VariableStorageImpl(private val session: FirSession) : VariableStorage() { fun clear(): VariableStorageImpl = VariableStorageImpl(session) - fun getOrCreateRealVariableWithoutUnwrappingAlias( + fun getOrCreateRealVariableWithoutUnwrappingAliasForPropertyInitialization( flow: Flow, symbol: FirBasedSymbol<*>, fir: FirElement, - stability: PropertyStability ): RealVariable { val realFir = fir.unwrapElement() val identifier = getIdentifierBySymbol(flow, symbol, realFir) + val stability = symbol.getStability(fir) + requireNotNull(stability) { "Stability for initialized variable always should be computable" } return _realVariables[identifier] ?: createReal(flow, identifier, realFir, stability) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/localDelegatedProperty.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/localDelegatedProperty.kt new file mode 100644 index 00000000000..a7a2158dde4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/localDelegatedProperty.kt @@ -0,0 +1,13 @@ +// FIR_IDENTICAL +// WITH_STDLIB +// ISSUE: KT-57502 + +import kotlin.properties.Delegates + +fun test(foo: Any) { + var test by Delegates.observable(true) { property, oldValue, newValue -> } + test = foo is String + if (test) { + foo.length // no smartcast + } +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializer.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializer.fir.kt index 198a64f4326..1cbe7c3bc89 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializer.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializer.fir.kt @@ -15,6 +15,6 @@ fun foo(arg: Int?) { var z = arg z = z?.let { 42 } if (z != null) { - arg.hashCode() + arg.hashCode() } } diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index d8ecd80f66b..3f2c5254ffe 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -32155,6 +32155,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.kt"); } + @Test + @TestMetadata("localDelegatedProperty.kt") + public void testLocalDelegatedProperty() throws Exception { + runTest("compiler/testData/diagnostics/tests/smartCasts/variables/localDelegatedProperty.kt"); + } + @Test @TestMetadata("objectMembers.kt") public void testObjectMembers() throws Exception {