[FIR] KT-55552: Ensure type mismatch is missing

This commit is contained in:
Nikolay Lunyak
2023-05-12 11:19:42 +03:00
committed by Space Team
parent 56f977f70c
commit 81d955a712
7 changed files with 56 additions and 0 deletions
@@ -225,6 +225,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/DeferredTypes.kt");
}
@Test
@TestMetadata("delegationTypeMismatch.kt")
public void testDelegationTypeMismatch() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegationTypeMismatch.kt");
}
@Test
@TestMetadata("DeprecatedGetSetPropertyDelegateConvention.kt")
public void testDeprecatedGetSetPropertyDelegateConvention() throws Exception {
@@ -225,6 +225,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/DeferredTypes.kt");
}
@Test
@TestMetadata("delegationTypeMismatch.kt")
public void testDelegationTypeMismatch() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegationTypeMismatch.kt");
}
@Test
@TestMetadata("DeprecatedGetSetPropertyDelegateConvention.kt")
public void testDeprecatedGetSetPropertyDelegateConvention() throws Exception {
@@ -225,6 +225,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/DeferredTypes.kt");
}
@Test
@TestMetadata("delegationTypeMismatch.kt")
public void testDelegationTypeMismatch() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegationTypeMismatch.kt");
}
@Test
@TestMetadata("DeprecatedGetSetPropertyDelegateConvention.kt")
public void testDeprecatedGetSetPropertyDelegateConvention() throws Exception {
@@ -225,6 +225,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/DeferredTypes.kt");
}
@Test
@TestMetadata("delegationTypeMismatch.kt")
public void testDelegationTypeMismatch() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegationTypeMismatch.kt");
}
@Test
@TestMetadata("DeprecatedGetSetPropertyDelegateConvention.kt")
public void testDeprecatedGetSetPropertyDelegateConvention() throws Exception {
@@ -0,0 +1,13 @@
// ISSUE: KT-55552
interface B2 {
fun d()
}
class B
open class C(b: B) : B2 by b {} //no error in K2, K1 - [TYPE_MISMATCH] Type mismatch: inferred type is B but B2 was expected
fun main() {
val c = C(B()).d() //runtime AbstractMethodError
}
@@ -0,0 +1,13 @@
// ISSUE: KT-55552
interface B2 {
fun d()
}
class B
open class C(b: B) : B2 by <!TYPE_MISMATCH!>b<!> {} //no error in K2, K1 - [TYPE_MISMATCH] Type mismatch: inferred type is B but B2 was expected
fun main() {
val c = C(B()).d() //runtime AbstractMethodError
}
@@ -225,6 +225,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/DeferredTypes.kt");
}
@Test
@TestMetadata("delegationTypeMismatch.kt")
public void testDelegationTypeMismatch() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegationTypeMismatch.kt");
}
@Test
@TestMetadata("DeprecatedGetSetPropertyDelegateConvention.kt")
public void testDeprecatedGetSetPropertyDelegateConvention() throws Exception {