[FE, Tests] Passing context(A, B) where context(B, A) expected

This commit is contained in:
Anastasiya Shadrina
2021-11-18 16:23:59 +07:00
committed by TeamCityServer
parent 08570a37b8
commit 752bc299f1
7 changed files with 68 additions and 0 deletions
@@ -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)
}
@@ -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<!>)
}
@@ -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
}