K2: add test to reproduce KT-64266
This commit is contained in:
committed by
Space Team
parent
81efc8d7c7
commit
44aa2d86d3
+6
@@ -22886,6 +22886,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/javac/Lambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LambdaNonGeneric.kt")
|
||||
public void testLambdaNonGeneric() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/javac/LambdaNonGeneric.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/javac/fieldsResolution")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -22886,6 +22886,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/javac/Lambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LambdaNonGeneric.kt")
|
||||
public void testLambdaNonGeneric() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/javac/LambdaNonGeneric.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/javac/fieldsResolution")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -22880,6 +22880,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/tests/javac/Lambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LambdaNonGeneric.kt")
|
||||
public void testLambdaNonGeneric() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/javac/LambdaNonGeneric.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/javac/fieldsResolution")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -22886,6 +22886,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/tests/javac/Lambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LambdaNonGeneric.kt")
|
||||
public void testLambdaNonGeneric() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/javac/LambdaNonGeneric.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/javac/fieldsResolution")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// -- Module: <m1> --
|
||||
|
||||
// -- Module: <m2> --
|
||||
/m2.kt:13:9: warning: parameter 'f' is never used
|
||||
fun foo(f: (Some, String) -> Unit) {}
|
||||
^
|
||||
/m2.kt:14:9: warning: parameter 'f' is never used
|
||||
fun bar(f: (Some) -> Unit) {}
|
||||
^
|
||||
|
||||
// -- Module: <m3> --
|
||||
/m3.kt:23:17: error: unresolved reference: Some
|
||||
foo { some: Some, _ -> }
|
||||
^
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/m3.kt:(72,73): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
|
||||
/m3.kt:(92,96): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
|
||||
/m3.kt:(117,121): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
|
||||
/m3.kt:(128,132): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
|
||||
/m3.kt:(162,166): error: Unresolved reference 'Some'.
|
||||
|
||||
/m3.kt:(184,187): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
|
||||
/m3.kt:(198,199): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
|
||||
/m3.kt:(215,217): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
|
||||
/m3.kt:(231,248): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
|
||||
/m3.kt:(233,235): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
|
||||
/m3.kt:(259,263): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
|
||||
/m3.kt:(267,271): error: Cannot access class 'Some'. Check your module classpath for missing or conflicting dependencies.
|
||||
@@ -0,0 +1,30 @@
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER
|
||||
// ISSUE: KT-64266
|
||||
|
||||
// MODULE: m1
|
||||
// FILE: m1.kt
|
||||
|
||||
class Some
|
||||
|
||||
// MODULE: m2(m1)
|
||||
// FILE: m2.kt
|
||||
|
||||
fun foo(f: (Some, String) -> Unit) {}
|
||||
fun bar(f: (Some) -> Unit) {}
|
||||
|
||||
// MODULE: m3(m2)
|
||||
// FILE: m3.kt
|
||||
|
||||
fun test() {
|
||||
foo { <!MISSING_DEPENDENCY_CLASS!>_<!>, _ -> }
|
||||
foo { <!MISSING_DEPENDENCY_CLASS!>some<!>, str -> }
|
||||
foo { <!MISSING_DEPENDENCY_CLASS!>some<!>, _ -> <!MISSING_DEPENDENCY_CLASS!>some<!>.toString() }
|
||||
foo { some: <!UNRESOLVED_REFERENCE!>Some<!>, _ -> }
|
||||
|
||||
bar <!MISSING_DEPENDENCY_CLASS!>{ }<!>
|
||||
bar { <!MISSING_DEPENDENCY_CLASS!>_<!> -> }
|
||||
bar { <!MISSING_DEPENDENCY_CLASS!>it<!> -> }
|
||||
bar <!MISSING_DEPENDENCY_CLASS!>{ <!MISSING_DEPENDENCY_CLASS!>it<!>.toString() }<!>
|
||||
bar { <!MISSING_DEPENDENCY_CLASS!>some<!> -> <!MISSING_DEPENDENCY_CLASS!>some<!>.toString() }
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER
|
||||
// ISSUE: KT-64266
|
||||
|
||||
// MODULE: m1
|
||||
// FILE: m1.kt
|
||||
|
||||
class Some
|
||||
|
||||
// MODULE: m2(m1)
|
||||
// FILE: m2.kt
|
||||
|
||||
fun foo(f: (Some, String) -> Unit) {}
|
||||
fun bar(f: (Some) -> Unit) {}
|
||||
|
||||
// MODULE: m3(m2)
|
||||
// FILE: m3.kt
|
||||
|
||||
fun test() {
|
||||
foo { _, _ -> }
|
||||
foo { some, str -> }
|
||||
foo { some, _ -> some.toString() }
|
||||
foo { some: <!UNRESOLVED_REFERENCE!>Some<!>, _ -> }
|
||||
|
||||
bar { }
|
||||
bar { _ -> }
|
||||
bar { it -> }
|
||||
bar { it.toString() }
|
||||
bar { some -> some.toString() }
|
||||
}
|
||||
Generated
+6
@@ -22886,6 +22886,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/javac/Lambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LambdaNonGeneric.kt")
|
||||
public void testLambdaNonGeneric() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/javac/LambdaNonGeneric.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/javac/fieldsResolution")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -36,6 +36,12 @@ public class DiagnosticUsingJavacTestGenerated extends AbstractDiagnosticUsingJa
|
||||
runTest("compiler/testData/diagnostics/tests/javac/Lambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LambdaNonGeneric.kt")
|
||||
public void testLambdaNonGeneric() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/javac/LambdaNonGeneric.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/javac/fieldsResolution")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
Reference in New Issue
Block a user