FE: add tests for KT-53966 (positive/negative)
This commit is contained in:
committed by
Space Team
parent
12a083af25
commit
5a9e8b3c0a
+6
@@ -6273,6 +6273,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/exceptionInRepeatedAnnotation.kt");
|
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
|
@Test
|
||||||
@TestMetadata("immutableName.kt")
|
@TestMetadata("immutableName.kt")
|
||||||
public void testImmutableName() throws Exception {
|
public void testImmutableName() throws Exception {
|
||||||
|
|||||||
+6
@@ -27572,6 +27572,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/samConversions/samConversionToGeneric.kt");
|
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
|
@Test
|
||||||
@TestMetadata("samConversionsWithSmartCasts.kt")
|
@TestMetadata("samConversionsWithSmartCasts.kt")
|
||||||
public void testSamConversionsWithSmartCasts() throws Exception {
|
public void testSamConversionsWithSmartCasts() throws Exception {
|
||||||
|
|||||||
+16
@@ -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|
|
||||||
|
}
|
||||||
|
) })
|
||||||
|
}
|
||||||
+13
@@ -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 })
|
||||||
|
}
|
||||||
+6
@@ -6273,6 +6273,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/exceptionInRepeatedAnnotation.kt");
|
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
|
@Test
|
||||||
@TestMetadata("immutableName.kt")
|
@TestMetadata("immutableName.kt")
|
||||||
public void testImmutableName() throws Exception {
|
public void testImmutableName() throws Exception {
|
||||||
|
|||||||
+6
@@ -6273,6 +6273,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/exceptionInRepeatedAnnotation.kt");
|
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
|
@Test
|
||||||
@TestMetadata("immutableName.kt")
|
@TestMetadata("immutableName.kt")
|
||||||
public void testImmutableName() throws Exception {
|
public void testImmutableName() throws Exception {
|
||||||
|
|||||||
+6
@@ -27584,6 +27584,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/samConversions/samConversionToGeneric.kt");
|
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
|
@Test
|
||||||
@TestMetadata("samConversionsWithSmartCasts.kt")
|
@TestMetadata("samConversionsWithSmartCasts.kt")
|
||||||
public void testSamConversionsWithSmartCasts() throws Exception {
|
public void testSamConversionsWithSmartCasts() throws Exception {
|
||||||
|
|||||||
+6
@@ -27572,6 +27572,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/samConversions/samConversionToGeneric.kt");
|
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
|
@Test
|
||||||
@TestMetadata("samConversionsWithSmartCasts.kt")
|
@TestMetadata("samConversionsWithSmartCasts.kt")
|
||||||
public void testSamConversionsWithSmartCasts() throws Exception {
|
public void testSamConversionsWithSmartCasts() throws Exception {
|
||||||
|
|||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
fun main() {
|
||||||
|
val flag = true
|
||||||
|
consumeTicker(
|
||||||
|
if (flag) null else <!ARGUMENT_TYPE_MISMATCH!>{ num -> num.<!UNRESOLVED_REFERENCE!>dec<!>() }<!>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consumeTicker(ticker: Ticker?) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun interface Ticker {
|
||||||
|
fun tick(num: Int)
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
fun main() {
|
||||||
|
val flag = true
|
||||||
|
consumeTicker(
|
||||||
|
if (flag) null else { num -> num.dec() }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consumeTicker(ticker: Ticker?) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun interface Ticker {
|
||||||
|
fun tick(num: Int)
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun consumeTicker(/*0*/ ticker: Ticker?): kotlin.Unit
|
||||||
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
|
public fun interface Ticker {
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public abstract fun tick(/*0*/ num: kotlin.Int): kotlin.Unit
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
Generated
+6
@@ -27584,6 +27584,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/samConversions/samConversionToGeneric.kt");
|
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
|
@Test
|
||||||
@TestMetadata("samConversionsWithSmartCasts.kt")
|
@TestMetadata("samConversionsWithSmartCasts.kt")
|
||||||
public void testSamConversionsWithSmartCasts() throws Exception {
|
public void testSamConversionsWithSmartCasts() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user