Context receivers broken with functional interface...
# language-proposals
e
Context receivers broken with functional interfaces? IntelliJ suggests replacing this
Copy code
object : MultipleElementDecoder<List<T>> {
        context(ByteArrayReader)
        override fun decode(numberOfElements: Int): List<T> {
            return (1..numberOfElements).map { readUntil('/').decodeNumericRange(block) }
        }
    }
with this lambda:
Copy code
MultipleElementDecoder { numberOfElements -> (1..numberOfElements).map { readUntil('/').decodeNumericRange(block) } }
But then it complains.. Not even sure what to start searching for in Youtrack.. 😞
b
this probably isn't the best channel for bugs. but context receivers are still an early prototype so you should expect the tooling to be very half-baked for now. even just in code it's very rough around the edges and will be for a bit
e
I noticed.. had to remove all uses of context receivers cause they broke the compilation and/or runtime every now and then..