[FIR] KT-55552: Ensure type mismatch is missing
This commit is contained in:
committed by
Space Team
parent
56f977f70c
commit
81d955a712
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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
|
||||
}
|
||||
Generated
+6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user