diff --git a/compiler/testData/diagnostics/tests/smartCasts/severalSmartCastsOnReified.kt b/compiler/testData/diagnostics/tests/smartCasts/severalSmartCastsOnReified.kt new file mode 100644 index 00000000000..84fe47bbbc1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/severalSmartCastsOnReified.kt @@ -0,0 +1,11 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER + +inline fun foo(y: Any?) { + if (y is T?) { + if (y != null) { + bar(y) + } + } +} + +fun bar(x: CharSequence) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/severalSmartCastsOnReified.txt b/compiler/testData/diagnostics/tests/smartCasts/severalSmartCastsOnReified.txt new file mode 100644 index 00000000000..f04d1732288 --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/severalSmartCastsOnReified.txt @@ -0,0 +1,4 @@ +package + +public fun bar(/*0*/ x: kotlin.CharSequence): kotlin.Unit +public inline fun foo(/*0*/ y: kotlin.Any?): kotlin.Unit diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 4445f3924cf..09a36ea539d 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -20818,6 +20818,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { doTest(fileName); } + @TestMetadata("severalSmartCastsOnReified.kt") + public void testSeveralSmartCastsOnReified() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/severalSmartCastsOnReified.kt"); + doTest(fileName); + } + @TestMetadata("shortIfExprNotNull.kt") public void testShortIfExprNotNull() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/shortIfExprNotNull.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index ca2db51fae6..d975eb8fa24 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -20818,6 +20818,12 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing doTest(fileName); } + @TestMetadata("severalSmartCastsOnReified.kt") + public void testSeveralSmartCastsOnReified() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/severalSmartCastsOnReified.kt"); + doTest(fileName); + } + @TestMetadata("shortIfExprNotNull.kt") public void testShortIfExprNotNull() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/shortIfExprNotNull.kt");