I’ve upgraded to
#compose-desktop 0.4.0-build183 and started getting this error:
e: …/SnakeLayout.kt: (30, 42): Type inference failed. Expected type mismatch: inferred type is @Composable() (Int, T) -> Unit but (Int, T) -> Unit was expected
Code is kinda like this:
fun <T> SnakeLayout(…,
content: @Composable (Int, T) -> Unit) {
Layout(…,
content = { items.forEachIndexed(content) } // here
) { … }
}
If I expand the call to
items.forEachIndexed { i, t -> content(i,t) }
it works fine. In version 0.4.0-build180 both variants worked.
(posting here, because I believe it is more to do with compiler plugin than desktop lib)