[Test] KT-61937: add tests with context functions and naming clash
Update tests for ^KT-61937 Merge-request: KT-MR-13678 Merged-by: Anzhela Sukhanova <anzhela.sukhanova@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
cf494ada0b
commit
7587f73846
+6
@@ -13569,6 +13569,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContext.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContext.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaReceiverFromContextWithSameFunctions.kt")
|
||||||
|
public void testLambdaReceiverFromContextWithSameFunctions() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContextWithSameFunctions.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("lazy.kt")
|
@TestMetadata("lazy.kt")
|
||||||
public void testLazy() throws Exception {
|
public void testLazy() throws Exception {
|
||||||
|
|||||||
+6
@@ -13569,6 +13569,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContext.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContext.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaReceiverFromContextWithSameFunctions.kt")
|
||||||
|
public void testLambdaReceiverFromContextWithSameFunctions() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContextWithSameFunctions.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("lazy.kt")
|
@TestMetadata("lazy.kt")
|
||||||
public void testLazy() throws Exception {
|
public void testLazy() throws Exception {
|
||||||
|
|||||||
+6
@@ -13563,6 +13563,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContext.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContext.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaReceiverFromContextWithSameFunctions.kt")
|
||||||
|
public void testLambdaReceiverFromContextWithSameFunctions() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContextWithSameFunctions.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("lazy.kt")
|
@TestMetadata("lazy.kt")
|
||||||
public void testLazy() throws Exception {
|
public void testLazy() throws Exception {
|
||||||
|
|||||||
+6
@@ -13569,6 +13569,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContext.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContext.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaReceiverFromContextWithSameFunctions.kt")
|
||||||
|
public void testLambdaReceiverFromContextWithSameFunctions() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContextWithSameFunctions.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("lazy.kt")
|
@TestMetadata("lazy.kt")
|
||||||
public void testLazy() throws Exception {
|
public void testLazy() throws Exception {
|
||||||
|
|||||||
Vendored
+6
@@ -11,3 +11,9 @@ class A {
|
|||||||
body()
|
body()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context(Ctx)
|
||||||
|
fun bar(body: Ctx.() -> Unit) {
|
||||||
|
foo()
|
||||||
|
body()
|
||||||
|
}
|
||||||
|
|||||||
Vendored
+6
@@ -11,3 +11,9 @@ class A {
|
|||||||
body<!NO_VALUE_FOR_PARAMETER!>()<!>
|
body<!NO_VALUE_FOR_PARAMETER!>()<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context(Ctx)
|
||||||
|
fun bar(body: Ctx.() -> Unit) {
|
||||||
|
foo()
|
||||||
|
body<!NO_VALUE_FOR_PARAMETER!>()<!>
|
||||||
|
}
|
||||||
|
|||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// ISSUE: KT-61937
|
||||||
|
// !LANGUAGE: +ContextReceivers
|
||||||
|
|
||||||
|
class Ctx
|
||||||
|
|
||||||
|
context(Ctx)
|
||||||
|
fun Ctx.foo(): String = "NOK"
|
||||||
|
|
||||||
|
context(Ctx)
|
||||||
|
fun bar(foo: Ctx.() -> String ): String {
|
||||||
|
return foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String = with (Ctx()) {
|
||||||
|
bar { "OK" }
|
||||||
|
}
|
||||||
Generated
+6
@@ -13569,6 +13569,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContext.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContext.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaReceiverFromContextWithSameFunctions.kt")
|
||||||
|
public void testLambdaReceiverFromContextWithSameFunctions() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lambdaReceiverFromContextWithSameFunctions.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("lazy.kt")
|
@TestMetadata("lazy.kt")
|
||||||
public void testLazy() throws Exception {
|
public void testLazy() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user