Why are `MutableState<T>.setValue` / `Mutabl...
# compose
f
Why are
MutableState<T>.setValue
/
MutableState<T>.getValue
extension methods instead of instance methods? This creates some confusion for me when I write
by state{}
and it errors, and I need to use the import quickfix.
z
https://developer.android.com/jetpack/androidx/releases/compose#0.1.0-dev09:
[Mutable]State property delegate operators moved to extensions to support Kotlin 1.4 property delegate optimizations. Callers must add imports to continue using by state { ... } or by mutableStateOf(...). (I5312c)
☝️ 1
a
Ideally we can get studio doing this in one step rather than several, but yeah, it's to benefit from the inlining in 1.4
l
yeah, plan on the IDE doing a better job w/ this at some point
🙏 1
but them being extension functions are actually pretty critical