K2: reproduce KT-57880

This commit is contained in:
Mikhail Glukhikh
2023-04-15 11:34:14 +02:00
committed by Space Team
parent ed4cc99db3
commit 089222cecc
7 changed files with 56 additions and 0 deletions
@@ -21032,6 +21032,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt");
}
@Test
@TestMetadata("labelToOuterLambda.kt")
public void testLabelToOuterLambda() throws Exception {
runTest("compiler/testData/diagnostics/tests/labels/labelToOuterLambda.kt");
}
@Test
@TestMetadata("labeledFunctionLiteral.kt")
public void testLabeledFunctionLiteral() throws Exception {
@@ -21032,6 +21032,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt");
}
@Test
@TestMetadata("labelToOuterLambda.kt")
public void testLabelToOuterLambda() throws Exception {
runTest("compiler/testData/diagnostics/tests/labels/labelToOuterLambda.kt");
}
@Test
@TestMetadata("labeledFunctionLiteral.kt")
public void testLabeledFunctionLiteral() throws Exception {
@@ -21032,6 +21032,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt");
}
@Test
@TestMetadata("labelToOuterLambda.kt")
public void testLabelToOuterLambda() throws Exception {
runTest("compiler/testData/diagnostics/tests/labels/labelToOuterLambda.kt");
}
@Test
@TestMetadata("labeledFunctionLiteral.kt")
public void testLabeledFunctionLiteral() throws Exception {
@@ -21038,6 +21038,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt");
}
@Test
@TestMetadata("labelToOuterLambda.kt")
public void testLabelToOuterLambda() throws Exception {
runTest("compiler/testData/diagnostics/tests/labels/labelToOuterLambda.kt");
}
@Test
@TestMetadata("labeledFunctionLiteral.kt")
public void testLabeledFunctionLiteral() throws Exception {
@@ -0,0 +1,13 @@
// ISSUE: KT-57880
fun outerLambda(action: String.() -> Unit) {}
var lambda: Int.() -> Unit = {}
fun consume(arg: String) {}
fun main() {
outerLambda {
lambda = {
consume(<!ARGUMENT_TYPE_MISMATCH!>this@outerLambda<!>)
}
}
}
@@ -0,0 +1,13 @@
// ISSUE: KT-57880
fun outerLambda(action: String.() -> Unit) {}
var lambda: Int.() -> Unit = {}
fun consume(arg: String) {}
fun main() {
outerLambda {
lambda = {
consume(this@outerLambda)
}
}
}
@@ -21038,6 +21038,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt");
}
@Test
@TestMetadata("labelToOuterLambda.kt")
public void testLabelToOuterLambda() throws Exception {
runTest("compiler/testData/diagnostics/tests/labels/labelToOuterLambda.kt");
}
@Test
@TestMetadata("labeledFunctionLiteral.kt")
public void testLabeledFunctionLiteral() throws Exception {