FE: add tests for KT-53966 (positive/negative)

This commit is contained in:
Mikhail Glukhikh
2023-01-19 12:46:22 +01:00
committed by Space Team
parent 12a083af25
commit 5a9e8b3c0a
12 changed files with 110 additions and 0 deletions
@@ -0,0 +1,16 @@
FILE: test.kt
public final class Wrapper : R|kotlin/Any| {
public constructor(si: R|SamInterface?|): R|Wrapper| {
super<R|kotlin/Any|>()
}
public final val si: R|SamInterface?| = R|<local>/si|
public get(): R|SamInterface?|
}
public final fun test(w: R|Wrapper?|): R|kotlin/Unit| {
R|/Wrapper.Wrapper|(R|<local>/w|?.{ $subj$.R|kotlin/let|<R|Wrapper|, R|SamInterface?|>(<L> = let@fun <anonymous>(it: R|Wrapper|): R|SamInterface?| <inline=Inline, kind=EXACTLY_ONCE> {
^ R|<local>/it|.R|/Wrapper.si|
}
) })
}
@@ -0,0 +1,13 @@
// FILE: SamInterface.java
public interface SamInterface {
public boolean foo(String arg);
}
// FILE: test.kt
class Wrapper(val si: SamInterface?)
fun test(w: Wrapper?) {
Wrapper(w?.let { it.si })
}
@@ -6273,6 +6273,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/exceptionInRepeatedAnnotation.kt");
}
@Test
@TestMetadata("falseSamConversion.kt")
public void testFalseSamConversion() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/falseSamConversion.kt");
}
@Test
@TestMetadata("immutableName.kt")
public void testImmutableName() throws Exception {
@@ -6273,6 +6273,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/exceptionInRepeatedAnnotation.kt");
}
@Test
@TestMetadata("falseSamConversion.kt")
public void testFalseSamConversion() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/falseSamConversion.kt");
}
@Test
@TestMetadata("immutableName.kt")
public void testImmutableName() throws Exception {
@@ -27584,6 +27584,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
runTest("compiler/testData/diagnostics/tests/samConversions/samConversionToGeneric.kt");
}
@Test
@TestMetadata("samConversionWithCondition.kt")
public void testSamConversionWithCondition() throws Exception {
runTest("compiler/testData/diagnostics/tests/samConversions/samConversionWithCondition.kt");
}
@Test
@TestMetadata("samConversionsWithSmartCasts.kt")
public void testSamConversionsWithSmartCasts() throws Exception {
@@ -27572,6 +27572,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
runTest("compiler/testData/diagnostics/tests/samConversions/samConversionToGeneric.kt");
}
@Test
@TestMetadata("samConversionWithCondition.kt")
public void testSamConversionWithCondition() throws Exception {
runTest("compiler/testData/diagnostics/tests/samConversions/samConversionWithCondition.kt");
}
@Test
@TestMetadata("samConversionsWithSmartCasts.kt")
public void testSamConversionsWithSmartCasts() throws Exception {