Fixed
Status Update
Comments
sw...@gmail.com <sw...@gmail.com> #2
Not clear where the problem is exactly, so I've posted this issue on kotlinx-collections
repository as well.
ch...@google.com <ch...@google.com> #3
persistentListOf()
returns a PersistentList<T>
where toImmutableList()
returns an ImmutableList<T>
. We only have special cased
kotlinx.collections.immutable.ImmutableList
kotlinx.collections.immutable.ImmutableSet
kotlinx.collections.immutable.ImmutableMap
We should consider adding PersistentList<T>
and friends to this list or considering any interface that derives from any of the above also stable.
al...@gmail.com <al...@gmail.com> #4
Hello any plans when this could be added ?
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit a91b7d222899c073168661eccc465034106f9895
Author: Andrew Bailey <anbailey@google.com>
Date: Mon Dec 05 11:39:51 2022
Make more of kotlinx.collections.immutable stable
This addresses two issues around stability inferencing for types in the
kotlinx.collections.immutable library. We have a few exceptions to treat
ImmutableList, ImmutableSet, and ImmutableMap as stable types, but we
don't have anything for ImmutableCollection or their Persistent
siblings. This CL adds those exceptions.
We also haven't marked any of their corresponding `*Of()` builders as
stable, which this CL also adds exceptions for.
Bug: 238057117
Bug: 254435410
Test: ClassStabilityTransformTests
Change-Id: Ie19290bfb53dd667e866681f11f266ae7bdb6201
M compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/ClassStabilityTransformTests.kt
M compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/analysis/Stability.kt
https://android-review.googlesource.com/2328593
Branch: androidx-main
commit a91b7d222899c073168661eccc465034106f9895
Author: Andrew Bailey <anbailey@google.com>
Date: Mon Dec 05 11:39:51 2022
Make more of kotlinx.collections.immutable stable
This addresses two issues around stability inferencing for types in the
kotlinx.collections.immutable library. We have a few exceptions to treat
ImmutableList, ImmutableSet, and ImmutableMap as stable types, but we
don't have anything for ImmutableCollection or their Persistent
siblings. This CL adds those exceptions.
We also haven't marked any of their corresponding `*Of()` builders as
stable, which this CL also adds exceptions for.
Bug: 238057117
Bug: 254435410
Test: ClassStabilityTransformTests
Change-Id: Ie19290bfb53dd667e866681f11f266ae7bdb6201
M compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/ClassStabilityTransformTests.kt
M compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/analysis/Stability.kt
an...@google.com <an...@google.com> #6
This is addressed in [CL 2328593](https://android-review.googlesource.com/2328593 ). You should start to see the expected behavior an upcoming version of the Compose compiler.
Description
Jetpack Compose version: 1.3.0-rc01
Jetpack Compose component(s) used: 1.7.20
Android Studio Build: #AI-222.3739.54.2221.9043926, built on September 9, 2022
Kotlin version: 1.7.20
Description: ImmutableList is considered stable by the compiler, but creating a list of integers using
persistentListOf(0,1,2)
will cause recompositions. Creating list usinglistOf(0,1).toImmutableList()
won't.Steps to Reproduce or Code Sample to Reproduce:
Or use a repository created for the issue:https://github.com/Skyyo/kotlinx-collections-issue .
This might be related to recent changes in https://issuetracker.google.com/issues/244700434 .