Hello people, I noticed Context Receivers don’t su...
# random
d
Hello people, I noticed Context Receivers don’t support star projection and variance annotation, e.g.: •
context(List<*>)
context(List<out SomeBaseStuff>)
As compilation crashes with
The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.psi2ir.generators.DescriptorStorageForContextReceivers.getSyntheticField(DescriptorStorageForContextReceivers.kt)
Caused by: java.lang.IllegalStateException: No synthetic field for receiver value …
Is this something expected and we’re just lacking IDE support, or is it something that will be fixed?
g
It is fixed in 1.8.20. Also, snippet underneath works well on my computer with Kotlin 1.8.20:
Copy code
fun main() {
    with(listOf(1, 2, 3)) {
        println(test())
    }
}

context(List<*>) fun test() = size
thank you color 1
d
Thank you!
Mh strange, we should be on 1.8.21 🤔 let me check the dependencies!