[PSI2IR] Check how contextual functional type works with IR
This commit is contained in:
committed by
TeamCityServer
parent
a59b9e78ac
commit
08570a37b8
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
fun withContext(f: context(String) () -> String) = f("OK")
|
||||
|
||||
fun callWithContext(f: (String) -> String) = withContext(f)
|
||||
|
||||
fun box(): String {
|
||||
return callWithContext { s -> s }
|
||||
}
|
||||
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class C {
|
||||
val result = "OK"
|
||||
}
|
||||
|
||||
fun contextual(f: context(C) () -> String) = f(C())
|
||||
|
||||
fun box(): String = contextual { result }
|
||||
Reference in New Issue
Block a user