ansman
02/15/2024, 2:31 PMclass C {
val a = 1
}
context(C)
fun foo() {
a // Works
this@C // Works
this@C.a // Works
}
val lambda: context(C) () -> Unit = {
a // Works
this@C // Does not work
this@C.a // Does not work
}
Youssef Shoaib [MOD]
02/15/2024, 2:33 PMcontext(A) fun <A> given(): A = this@A
given<C>() // Works
ansman
02/15/2024, 2:33 PMYoussef Shoaib [MOD]
02/15/2024, 2:34 PMList<String>
vs List<Int>
ansman
02/15/2024, 2:37 PM