Zach Klippenstein (he/him) [MOD]
11/01/2026, 5:02 PM@Composable
fun foo() = doSomething(LocalResources.current)
and
context(reader: CompositionLocalConsumerModifierNode)
fun foo() = doSomething(reader.currentValueOf(LocalResources))
This is unfortunate, since it seems like the compiler has enough information to clearly distinguish them in any case except when called from inside a composable where the context param type is also available, and in that case an ambiguity error would be fine (in my example, many things would have gone wrong to get to that point anyway).
I thought I saw that Kotlin made a change closer to the stabilization of context params that stopped using them to distinguish functions in resolution, and I'm sure they had good reasons to do so. But I would hope that context params and function color together would be sufficient. So I suspect this is a limitation of how context parameters are implemented and not something the Compose compiler can fix.shikasd
11/01/2026, 6:34 PMZach Klippenstein (he/him) [MOD]
11/03/2026, 6:46 PM