Hi guys, I'm new to the kotlinlang slack so I'm no...
# android
c
Hi guys, I'm new to the kotlinlang slack so I'm not sure if what I send is what I should send in this channel (if it's not please forgive me). I'm trying to put the following jetpack-compose code in a separate gradle module called
ui_components
(android library)
Copy code
/**
 * Display a vertical list of [OutlinedTextField]
 */
@Composable
fun Form(fields: List<FormField>) {
    LazyColumn(content = {
        items(fields) { item ->
            OutlinedTextField(
                value = item.mutableState.value,
                onValueChange = { item.mutableState.value = it },
                label = { Text(text = stringResource(id = item.label)) },
                isError = item.isError(item.mutableState.value)
            )
        }
    })
}
However, when I compile the logs show me the following error:
Copy code
e: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'items' into
local final fun androidx.compose.foundation.lazy.LazyListScope.<anonymous>(): kotlin.Unit defined in com.xxx.xxx.ui_components.Form
{
        items(fields) { item ->
            OutlinedTextField(
                value = item.mutableState.value,
                onValueChange = { item.mutableState.value = it },
                label = { Text(text = stringResource(id = item.label)) },
                isError = item.isError(item.mutableState.value)
            )
        }
    }
Am I doing something wrong here? Because individually the module compile (so no dependency missing, I guess) and without the dependency to
ui_components
the app compiles. Would be great if you can explain me, thanks in advance! 🙏
o
#compose Also, you'll never go wrong with filing an issue whenever you encounter something that describes itself as a "Back-end compiler error".
🙏 1