kotlinx-metadata: support experimental context receivers
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user