This might be another snippet that triggers a comp...
# compose
s
This might be another snippet that triggers a compiler error. However, my compose version is not the latest (and I'm unable to upgrade it right now). Would you tell me if it's not fixed yet, so I can open an issue? (similar version that compiles in thread).
Copy code
@Composable
fun Err() {
    suspend fun AwaitPointerEventScope.handler() {
        awaitPointerEvent(pass = PointerEventPass.Initial).changes.forEach {
            it // <-- triggers the compiler error
        }
    }

    Spacer(modifier = Modifier.pointerInput(Unit) {
        awaitPointerEventScope {
            handler()
        }
    })
}
Fine version:
Copy code
@Composable
fun Ok() {
    val handler: suspend AwaitPointerEventScope.() -> Unit = {
        awaitPointerEvent(pass = PointerEventPass.Initial).changes.forEach {
            it
        }
    }

    Spacer(modifier = Modifier.pointerInput(Unit) {
        awaitPointerEventScope {
            handler()
        }
    })
}
Still present in
1.1.0-alpha04
z
What’s the compiler error?
s
(I also opened an issue here)