Closed bethcutler closed 3 years ago
I haven't played a lot with Compose, but that is not the same as this?
object FooBar {
@Composable
fun DoFoo(): (Modifier) -> Unit {
return { modifier -> println(modifier) }
}
}
I don't know much about Compose either, but I am told that those two locations for the annotation have different meanings.
In any case, this is valid Kotlin code, so the formatter should be able to handle it gracefully.
@bethcutler I believe this is a duplicate of https://github.com/facebookincubator/ktfmt/issues/186, fixed in https://github.com/facebookincubator/ktfmt/commit/f6c762acef72cd6e291926474925560d95c1038a and released in https://github.com/facebookincubator/ktfmt/releases/tag/v0.22.
The provided example seems to be working for me, can you give 0.22 a try?
For this sample code:
we get an error when formatting:
I have not found a workaround for this issue, and this pattern occurs in a handful of files... so it's a high priority for us.