[FIR] KT-56876: Ensure inner type classifiers are resolved in contracts

^KT-56876 Fixed
This commit is contained in:
Nikolay Lunyak
2023-03-08 11:54:53 +02:00
committed by Space Team
parent c156dfe855
commit 5cbe699fc4
5 changed files with 47 additions and 0 deletions
@@ -525,6 +525,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/kt56769.kt");
}
@Test
@TestMetadata("kt56876.kt")
public void testKt56876() throws Exception {
runTest("compiler/testData/diagnostics/tests/kt56876.kt");
}
@Test
@TestMetadata("kt56877.kt")
public void testKt56877() throws Exception {
@@ -525,6 +525,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/kt56769.kt");
}
@Test
@TestMetadata("kt56876.kt")
public void testKt56876() throws Exception {
runTest("compiler/testData/diagnostics/tests/kt56876.kt");
}
@Test
@TestMetadata("kt56877.kt")
public void testKt56877() throws Exception {
@@ -525,6 +525,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/kt56769.kt");
}
@Test
@TestMetadata("kt56876.kt")
public void testKt56876() throws Exception {
runTest("compiler/testData/diagnostics/tests/kt56876.kt");
}
@Test
@TestMetadata("kt56877.kt")
public void testKt56877() throws Exception {
+23
View File
@@ -0,0 +1,23 @@
// FIR_IDENTICAL
@file:OptIn(ExperimentalContracts::class)
import kotlin.contracts.*
open class Result {
class Success : Result()
fun isSuccess1(arg: Result): Boolean {
contract {
returns(true) implies (arg is Success)
}
return arg is Success
}
}
fun Result.isSuccess2(arg: Result): Boolean {
contract {
returns(true) implies (arg is <!UNRESOLVED_REFERENCE!>Success<!>)
}
return arg is <!UNRESOLVED_REFERENCE!>Success<!>
}
@@ -525,6 +525,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/kt56769.kt");
}
@Test
@TestMetadata("kt56876.kt")
public void testKt56876() throws Exception {
runTest("compiler/testData/diagnostics/tests/kt56876.kt");
}
@Test
@TestMetadata("kt56877.kt")
public void testKt56877() throws Exception {