[FE, Tests] Passing context(A, B) where context(B, A) expected
This commit is contained in:
committed by
TeamCityServer
parent
08570a37b8
commit
752bc299f1
+6
@@ -10594,6 +10594,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/contextReceiverTypeParamsUsageError.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("contextualFunctionalTypeConversion.kt")
|
||||
public void testContextualFunctionalTypeConversion() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/contextualFunctionalTypeConversion.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionalType.kt")
|
||||
public void testFunctionalType() throws Exception {
|
||||
|
||||
+6
@@ -10594,6 +10594,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/contextReceiverTypeParamsUsageError.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("contextualFunctionalTypeConversion.kt")
|
||||
public void testContextualFunctionalTypeConversion() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/contextualFunctionalTypeConversion.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionalType.kt")
|
||||
public void testFunctionalType() throws Exception {
|
||||
|
||||
+6
@@ -10594,6 +10594,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/contextReceiverTypeParamsUsageError.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("contextualFunctionalTypeConversion.kt")
|
||||
public void testContextualFunctionalTypeConversion() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/contextualFunctionalTypeConversion.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionalType.kt")
|
||||
public void testFunctionalType() throws Exception {
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
class A
|
||||
class B
|
||||
|
||||
fun expectAB(f: context(A, B) () -> Unit) {
|
||||
f(A(), <!TOO_MANY_ARGUMENTS!>B()<!>)
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val l: context(B, A) () -> Unit = { }
|
||||
expectAB(l)
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
class A
|
||||
class B
|
||||
|
||||
fun expectAB(f: context(A, B) () -> Unit) {
|
||||
f(A(), B())
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val l: context(B, A) () -> Unit = { }
|
||||
expectAB(<!TYPE_MISMATCH!>l<!>)
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package
|
||||
|
||||
public fun expectAB(/*0*/ f: context(A, B) () -> kotlin.Unit): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Generated
+6
@@ -10600,6 +10600,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/contextReceiverTypeParamsUsageError.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("contextualFunctionalTypeConversion.kt")
|
||||
public void testContextualFunctionalTypeConversion() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/contextualFunctionalTypeConversion.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionalType.kt")
|
||||
public void testFunctionalType() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user