kotlinx-metadata: support experimental context receivers

This commit is contained in:
Alexander Udalov
2022-06-14 00:32:38 +02:00
parent 6abf14087c
commit 61652c04e1
11 changed files with 194 additions and 2 deletions
+11
View File
@@ -0,0 +1,11 @@
// !LANGUAGE: +ContextReceivers
interface A
interface B
context(A) class C {
context(B) fun f() {}
}
context(A) fun g() {}
context(B) val h: Int get() = 42
+50
View File
@@ -0,0 +1,50 @@
// A.class
// ------------------------------------------
public abstract interface A : kotlin/Any {
// module name: test-module
}
// B.class
// ------------------------------------------
public abstract interface B : kotlin/Any {
// module name: test-module
}
// C.class
// ------------------------------------------
// requires compiler version 1.6.20 (level=ERROR)
context(A)
public final class C : kotlin/Any {
// signature: <init>(LA;)V
public constructor()
// requires compiler version 1.6.20 (level=ERROR)
// signature: f(LB;)V
context(B)
public final fun f(): kotlin/Unit
// module name: test-module
}
// ContextReceiversKt.class
// ------------------------------------------
package {
// requires compiler version 1.6.20 (level=ERROR)
// signature: g(LA;)V
context(A)
public final fun g(): kotlin/Unit
// requires compiler version 1.6.20 (level=ERROR)
// getter: getH(LB;)I
context(B)
public final val h: kotlin/Int
public final /* non-default */ get
}
// META-INF/test-module.kotlin_module
// ------------------------------------------
module {
package <root> {
ContextReceiversKt
}
}