K2: reproduce some situations related to KT-62134

This commit is contained in:
Mikhail Glukhikh
2024-01-31 12:09:02 +01:00
committed by Space Team
parent 36dd9b6818
commit 3c3396a87e
7 changed files with 80 additions and 0 deletions
@@ -40802,6 +40802,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/visibility/privateToThis.kt");
}
@Test
@TestMetadata("privateToThisExotic.kt")
public void testPrivateToThisExotic() throws Exception {
runTest("compiler/testData/diagnostics/tests/visibility/privateToThisExotic.kt");
}
@Test
@TestMetadata("protectedInternal.kt")
public void testProtectedInternal() throws Exception {
@@ -40802,6 +40802,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/visibility/privateToThis.kt");
}
@Test
@TestMetadata("privateToThisExotic.kt")
public void testPrivateToThisExotic() throws Exception {
runTest("compiler/testData/diagnostics/tests/visibility/privateToThisExotic.kt");
}
@Test
@TestMetadata("protectedInternal.kt")
public void testProtectedInternal() throws Exception {
@@ -38446,6 +38446,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/visibility/privateToThis.kt");
}
@Test
@TestMetadata("privateToThisExotic.kt")
public void testPrivateToThisExotic() throws Exception {
runTest("compiler/testData/diagnostics/tests/visibility/privateToThisExotic.kt");
}
@Test
@TestMetadata("protectedInternal.kt")
public void testProtectedInternal() throws Exception {
@@ -38572,6 +38572,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/visibility/privateToThis.kt");
}
@Test
@TestMetadata("privateToThisExotic.kt")
public void testPrivateToThisExotic() throws Exception {
runTest("compiler/testData/diagnostics/tests/visibility/privateToThisExotic.kt");
}
@Test
@TestMetadata("protectedInternal.kt")
public void testProtectedInternal() throws Exception {
@@ -0,0 +1,25 @@
// ISSUE: KT-62134
// FILE: Base.java
public class Base<T> {
public T foo() {
return null;
}
}
// FILE: test.kt
class Bar
class Foo<in T> : Base<<!TYPE_VARIANCE_CONFLICT_ERROR!>T<!>>() {
private val dnn: T & Any = TODO()
private val flex = foo()
fun bar(f: Foo<Bar>) {
val dnn = f.dnn
val flex = f.flex
}
}
@@ -0,0 +1,25 @@
// ISSUE: KT-62134
// FILE: Base.java
public class Base<T> {
public T foo() {
return null;
}
}
// FILE: test.kt
class Bar
class Foo<in T> : Base<<!TYPE_VARIANCE_CONFLICT_ERROR!>T<!>>() {
private val dnn: T & Any = TODO()
private val flex = foo()
fun bar(f: Foo<Bar>) {
val dnn = f.<!INVISIBLE_MEMBER!>dnn<!>
val flex = f.<!INVISIBLE_MEMBER!>flex<!>
}
}
@@ -40802,6 +40802,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/visibility/privateToThis.kt");
}
@Test
@TestMetadata("privateToThisExotic.kt")
public void testPrivateToThisExotic() throws Exception {
runTest("compiler/testData/diagnostics/tests/visibility/privateToThisExotic.kt");
}
@Test
@TestMetadata("protectedInternal.kt")
public void testProtectedInternal() throws Exception {