Fixed
Status Update
Comments
ch...@google.com <ch...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
lp...@google.com <lp...@google.com> #3
ch...@google.com <ch...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically ( b/140759491 ).
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
https://android-review.googlesource.com/1288456
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
lp...@google.com <lp...@google.com> #5
Sure thing, thanks for the context!
For anyone running into this issue, in the meantime the simple workaround is just consuming the ambient inside the body of the function, you don't explicitly need to use the returned value anywhere.
For anyone running into this issue, in the meantime the simple workaround is just consuming the ambient inside the body of the function, you don't explicitly need to use the returned value anywhere.
ch...@google.com <ch...@google.com> #6
Jim and I discussed this this morning and the reason it fails is because we skip the calls to composable methods at the call-site the call itself. We restart composition inside the callee. Kotlin lowers the adding of the default parameter into a synthetic method that calls the original method resulting in the ambient read sitting between skipping and restarting. Modifying the ambient restarts the caller's scope but that will then skip the call because the parameters haven't changed (from the callers perspective). If we invalidated the callee's scope composition would restart after inside the original method using the old value of the ambient because the synthetic that encodes the read is skipped.
After Jim's change, we already planned to move the skipping logic into the function being called. We also need to route the $static property (see Leland's ADS talk for a description of what $static is) or we will compare too many values and the slot table will grow (also described in Leland's talk). As part of that lowering we can take over the default value lowering from Kotlin and calculate both the $default and $static sets. This fixes this problem because this would cause the caller to be invalidated and re-execute the call, re-read the ambient, and then call the original function which will skip if the ambient is the same or execute if the ambient value is changed.
Next we plan to change how ambients work. The ambient values should be a map of ambient keys to State objects. Providing an ambient should create a new set with the provided value added. This would allow us to delete almost all of the of the special ambient logic in the composer which will also speed up both reading and updating ambients at the cost of additional overhead tracking the reads.
The combination of the above will cause this bug will go away. Fixing it before these changes would more difficult and would involve much of the work we are already planning.
However, we need a test case that ensures we indeed fix this case. Louis, it would be helpful if you would create a test case in our unit tests that reproduces this (FcsCodeGen would be a good place to add it)? We should add @Ignore to the new test (as it will fail) with a reference to this bug in the description.
After Jim's change, we already planned to move the skipping logic into the function being called. We also need to route the $static property (see Leland's ADS talk for a description of what $static is) or we will compare too many values and the slot table will grow (also described in Leland's talk). As part of that lowering we can take over the default value lowering from Kotlin and calculate both the $default and $static sets. This fixes this problem because this would cause the caller to be invalidated and re-execute the call, re-read the ambient, and then call the original function which will skip if the ambient is the same or execute if the ambient value is changed.
Next we plan to change how ambients work. The ambient values should be a map of ambient keys to State objects. Providing an ambient should create a new set with the provided value added. This would allow us to delete almost all of the of the special ambient logic in the composer which will also speed up both reading and updating ambients at the cost of additional overhead tracking the reads.
The combination of the above will cause this bug will go away. Fixing it before these changes would more difficult and would involve much of the work we are already planning.
However, we need a test case that ensures we indeed fix this case. Louis, it would be helpful if you would create a test case in our unit tests that reproduces this (FcsCodeGen would be a good place to add it)? We should add @Ignore to the new test (as it will fail) with a reference to this bug in the description.
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ac4f6cda04a9607998e2bb8babba35c350a81d55
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Wed Oct 30 18:59:59 2019
Test case for ensuring that ambient reads work inside default parameters
This currently does not work, but this test case should be un-@Ignored
once it is fixed.
Removing the @Ignore and changing:
`TextView(text = text, id = 42)`
to
`TextView(text = +ambient(TextAmbient), id = 42)`
Makes the test pass.
Bug: b/143464846
Test: testAmbientConsumedFromDefaultParameter
Change-Id: I8f8d069b39273dfaef40c6576b52ea426ef28b14
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FcsCodegenTests.kt
https://android-review.googlesource.com/1155144
https://goto.google.com/android-sha1/ac4f6cda04a9607998e2bb8babba35c350a81d55
Branch: androidx-master-dev
commit ac4f6cda04a9607998e2bb8babba35c350a81d55
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Wed Oct 30 18:59:59 2019
Test case for ensuring that ambient reads work inside default parameters
This currently does not work, but this test case should be un-@Ignored
once it is fixed.
Removing the @Ignore and changing:
`TextView(text = text, id = 42)`
to
`TextView(text = +ambient(TextAmbient), id = 42)`
Makes the test pass.
Bug:
Test: testAmbientConsumedFromDefaultParameter
Change-Id: I8f8d069b39273dfaef40c6576b52ea426ef28b14
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FcsCodegenTests.kt
an...@gmail.com <an...@gmail.com> #8
Block
le...@google.com <le...@google.com> #9
Assigning to me as a reminder that this can be marked as fixed once composer param work is done
le...@google.com <le...@google.com>
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 797bd0cda4fd10a1d9d8b3b06b5954644a200334
Author: Leland Richardson <lelandr@google.com>
Date: Thu May 07 15:16:51 2020
Turn on Function-body-based code generation strategy
Relnote: “
Changes the code generation strategy of Compose’s compiler. Prior to the change, the compose compiler would transform calls to composable functions. With this change, we now transform the body of a composable function and leave the callsite unaltered (mostly).
This means that most of the logic communicating with the compose runtime happens at the start of the function body, instead of at the callsite.
This should be a source-compatible change for all usage of compose. Most users of compose should not have to update any code as a result of this change.
In order to support this work, the JVM signature of all composable functions has changed. A Composable function accepting a single parameter is transformed into a function accepting 3 parameters, the additional parameters are the Composer, a ‘key’ integer. a bitmask integer used to propagate metadata through calls.
Compose now also transforms default arguments to a composable function. It does this without introducing an additional synthetic default overload of the function itself, so this change will result in fewer functions being defined.
Known intentional behavioral changes resulting from this:
1. Some calls will skip where they wouldn’t have previously
2. Composable expressions in default argument expressions are now correctly subscribed to and handled
This work included some optimizations:
1. The result of comparisons of parameters are propagated through the call graph to other composable functions. This will result in fewer comparisons at runtime, reduces the slot table size, as well as more skipping of composable functions that were previously not skipped
2. Paremeters which are determined to be “static” at compile time are no longer compared or stored in the runtime. This reduces the number of comparisons and reduces slot table size.
3. Control flow structure of the body of functions is used to minimize the number of groups that are generated. This reduces slot table size and results in less work for the runtime
4. Unused dispatch and receiver parameters to functions are not included in determining skippability of the function if they are not used inside of the body of the function.
Most breaking changes were for APIs that the compiler targets directly, and typical use of compose will not be affected:
1. Composer::startExpr was removed
2. Composer::endExpr was removed
3. Composer::call was deprecated
4. The non-varargs overloads of `key` have been removed. Use the `vararg` version going forward.
5. The Pivotal annotation was deprecated. Use `key` as a replacement.
6. ScopeUpdateScope::updateScope was changed to expect a Function3 instead of Function1
7. restartableFunction and restartableFunctionN were updated to include additional compile time parameters
“
Bug: 144283149
Bug: 144283416
Bug: 144283245
Bug: 150777987
Bug: 143464846
This effort has been a work in progress for some time, and much of the work has
been done in the following previous commits:
Make ComposableFunctionBodyTransformer work for any number of parameters
Icc265a253c629f5533f1e68e5109db67234311f9
Generate Movable groups with key and handle dynamic groups properly
I5fe7799eb303dadbbdd47d71fe764767407c4ae2
Function Body Skipping and Comparison Propagation
I2ee971458ea466ba070dff25da5a4f60d42ff678
Add Default Parameter IR Transform
If530f61034b284bb3e1a8919e2b0be2511e2f243
Handle Break/Continue in Control Flow Codegen
I2c2c3261886ab8936baeb8a5b5e6b8f5e9e8d409
Allow for early returns in control flow codegen
If6446a90b7364a31ae67816595408c0aa971a39a
Add ControlFlowTransformer WIP and tests
I1f96ab3e11e3f26bf4f9e375e00420d25463510d
Change-Id: I607560574d83b4b6c1e68ff72cc4124c5f8c2602
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/AbstractIrTransformTest.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/AbstractLoweringTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposeCallLoweringTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposeMultiPlatformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposerParamSignatureTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposerParamTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ControlFlowTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/DefaultParamTransformTests.kt
A compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/EmitTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FcsCodegenTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FcsModelCodeGenTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FunctionBodySkippingTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/KtxCrossModuleTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/KtxModelCodeGenTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/KtxTransformationTest.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/RobolectricComposeTester.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/ComposeEmitResolver.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/ComposeFqNames.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/ComposeIrGenerationExtension.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/KtxNameConventions.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/AbstractComposeLowering.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableCallTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableFunctionBodyTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableTypeRemapper.kt
D compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposeObservePatcher.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposerIntrinsicTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposerParamTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/IrSourcePrinter.kt
M compose/compose-runtime/api/0.1.0-dev12.txt
M compose/compose-runtime/api/current.txt
M compose/compose-runtime/api/public_plus_experimental_0.1.0-dev12.txt
M compose/compose-runtime/api/public_plus_experimental_current.txt
M compose/compose-runtime/api/restricted_0.1.0-dev12.txt
M compose/compose-runtime/api/restricted_current.txt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/siblings/SiblingManagement.kt
M compose/compose-runtime/samples/src/main/java/androidx/compose/samples/PivotalSamples.kt
M compose/compose-runtime/src/androidMain/kotlin/androidx/compose/KeySourceInfo.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Composer.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Key.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Pivotal.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/SlotTable.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/internal/RestartableFunction.kt
M compose/compose-runtime/src/jvmMain/kotlin/androidx/compose/internal/RestartableFunctionN.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/AndroidPointerInputTest.kt
M ui/ui-core/src/main/java/androidx/ui/core/ComposedModifier.kt
M ui/ui-core/src/main/java/androidx/ui/core/focus/FocusModifierImpl.kt
M ui/ui-core/src/main/java/androidx/ui/res/FontResources.kt
M ui/ui-core/src/test/java/androidx/ui/core/ComposedModifierTest.kt
M ui/ui-tooling/src/androidTest/java/androidx/ui/tooling/BoundsTest.kt
M ui/ui-tooling/src/androidTest/java/androidx/ui/tooling/InspectableTests.kt
M ui/ui-tooling/src/androidTest/java/androidx/ui/tooling/ModifierInfoTest.kt
M ui/ui-tooling/src/main/java/androidx/ui/tooling/preview/PreviewUtils.kt
https://android-review.googlesource.com/1286246
Branch: androidx-master-dev
commit 797bd0cda4fd10a1d9d8b3b06b5954644a200334
Author: Leland Richardson <lelandr@google.com>
Date: Thu May 07 15:16:51 2020
Turn on Function-body-based code generation strategy
Relnote: “
Changes the code generation strategy of Compose’s compiler. Prior to the change, the compose compiler would transform calls to composable functions. With this change, we now transform the body of a composable function and leave the callsite unaltered (mostly).
This means that most of the logic communicating with the compose runtime happens at the start of the function body, instead of at the callsite.
This should be a source-compatible change for all usage of compose. Most users of compose should not have to update any code as a result of this change.
In order to support this work, the JVM signature of all composable functions has changed. A Composable function accepting a single parameter is transformed into a function accepting 3 parameters, the additional parameters are the Composer, a ‘key’ integer. a bitmask integer used to propagate metadata through calls.
Compose now also transforms default arguments to a composable function. It does this without introducing an additional synthetic default overload of the function itself, so this change will result in fewer functions being defined.
Known intentional behavioral changes resulting from this:
1. Some calls will skip where they wouldn’t have previously
2. Composable expressions in default argument expressions are now correctly subscribed to and handled
This work included some optimizations:
1. The result of comparisons of parameters are propagated through the call graph to other composable functions. This will result in fewer comparisons at runtime, reduces the slot table size, as well as more skipping of composable functions that were previously not skipped
2. Paremeters which are determined to be “static” at compile time are no longer compared or stored in the runtime. This reduces the number of comparisons and reduces slot table size.
3. Control flow structure of the body of functions is used to minimize the number of groups that are generated. This reduces slot table size and results in less work for the runtime
4. Unused dispatch and receiver parameters to functions are not included in determining skippability of the function if they are not used inside of the body of the function.
Most breaking changes were for APIs that the compiler targets directly, and typical use of compose will not be affected:
1. Composer::startExpr was removed
2. Composer::endExpr was removed
3. Composer::call was deprecated
4. The non-varargs overloads of `key` have been removed. Use the `vararg` version going forward.
5. The Pivotal annotation was deprecated. Use `key` as a replacement.
6. ScopeUpdateScope::updateScope was changed to expect a Function3 instead of Function1
7. restartableFunction and restartableFunctionN were updated to include additional compile time parameters
“
Bug: 144283149
Bug: 144283416
Bug: 144283245
Bug: 150777987
Bug: 143464846
This effort has been a work in progress for some time, and much of the work has
been done in the following previous commits:
Make ComposableFunctionBodyTransformer work for any number of parameters
Icc265a253c629f5533f1e68e5109db67234311f9
Generate Movable groups with key and handle dynamic groups properly
I5fe7799eb303dadbbdd47d71fe764767407c4ae2
Function Body Skipping and Comparison Propagation
I2ee971458ea466ba070dff25da5a4f60d42ff678
Add Default Parameter IR Transform
If530f61034b284bb3e1a8919e2b0be2511e2f243
Handle Break/Continue in Control Flow Codegen
I2c2c3261886ab8936baeb8a5b5e6b8f5e9e8d409
Allow for early returns in control flow codegen
If6446a90b7364a31ae67816595408c0aa971a39a
Add ControlFlowTransformer WIP and tests
I1f96ab3e11e3f26bf4f9e375e00420d25463510d
Change-Id: I607560574d83b4b6c1e68ff72cc4124c5f8c2602
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/AbstractIrTransformTest.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/AbstractLoweringTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposeCallLoweringTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposeMultiPlatformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposerParamSignatureTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposerParamTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ControlFlowTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/DefaultParamTransformTests.kt
A compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/EmitTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FcsCodegenTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FcsModelCodeGenTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FunctionBodySkippingTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/KtxCrossModuleTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/KtxModelCodeGenTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/KtxTransformationTest.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/RobolectricComposeTester.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/ComposeEmitResolver.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/ComposeFqNames.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/ComposeIrGenerationExtension.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/KtxNameConventions.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/AbstractComposeLowering.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableCallTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableFunctionBodyTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableTypeRemapper.kt
D compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposeObservePatcher.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposerIntrinsicTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposerParamTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/IrSourcePrinter.kt
M compose/compose-runtime/api/0.1.0-dev12.txt
M compose/compose-runtime/api/current.txt
M compose/compose-runtime/api/public_plus_experimental_0.1.0-dev12.txt
M compose/compose-runtime/api/public_plus_experimental_current.txt
M compose/compose-runtime/api/restricted_0.1.0-dev12.txt
M compose/compose-runtime/api/restricted_current.txt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/siblings/SiblingManagement.kt
M compose/compose-runtime/samples/src/main/java/androidx/compose/samples/PivotalSamples.kt
M compose/compose-runtime/src/androidMain/kotlin/androidx/compose/KeySourceInfo.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Composer.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Key.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Pivotal.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/SlotTable.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/internal/RestartableFunction.kt
M compose/compose-runtime/src/jvmMain/kotlin/androidx/compose/internal/RestartableFunctionN.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/AndroidPointerInputTest.kt
M ui/ui-core/src/main/java/androidx/ui/core/ComposedModifier.kt
M ui/ui-core/src/main/java/androidx/ui/core/focus/FocusModifierImpl.kt
M ui/ui-core/src/main/java/androidx/ui/res/FontResources.kt
M ui/ui-core/src/test/java/androidx/ui/core/ComposedModifierTest.kt
M ui/ui-tooling/src/androidTest/java/androidx/ui/tooling/BoundsTest.kt
M ui/ui-tooling/src/androidTest/java/androidx/ui/tooling/InspectableTests.kt
M ui/ui-tooling/src/androidTest/java/androidx/ui/tooling/ModifierInfoTest.kt
M ui/ui-tooling/src/main/java/androidx/ui/tooling/preview/PreviewUtils.kt
le...@google.com <le...@google.com>
lp...@google.com <lp...@google.com> #11
Still seeing this in the demo app, switching from light -> dark theme doesn't cause the app bar to change color. But if I manually do:
val color = MaterialTheme.colors.primarySurface
TopAppBar(
...
backgroundColor = color,
...
)
(manually writing the default value)
Then this works correctly again.
tc...@google.com <tc...@google.com> #12
The initial change made it into Dev12 but these is an issue that came up that Leland is looking into and will be fixed in Alpha if necessary.
ap...@google.com <ap...@google.com> #13
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 458aaff814870edec3837f3ebe343f197a198697
Author: Leland Richardson <lelandr@google.com>
Date: Mon Jun 08 15:00:32 2020
Prevent non-static default expressions from being treated as static
Fixes: 143464846
Change-Id: I26c8a7f54581c38aede45c5db2f2a2a4ee2e39df
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/DefaultParamTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FunctionBodySkippingTransformTests.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableFunctionBodyTransformer.kt
https://android-review.googlesource.com/1326376
Branch: androidx-master-dev
commit 458aaff814870edec3837f3ebe343f197a198697
Author: Leland Richardson <lelandr@google.com>
Date: Mon Jun 08 15:00:32 2020
Prevent non-static default expressions from being treated as static
Fixes: 143464846
Change-Id: I26c8a7f54581c38aede45c5db2f2a2a4ee2e39df
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/DefaultParamTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FunctionBodySkippingTransformTests.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableFunctionBodyTransformer.kt
Description
```
@Composable
fun FooComponent(number: Int = +ambient(NumberAmbient)) {
...
}
NumberAmbient.Provider(someChangingValue) {
FooComponent()
}
```
When the ambient value changes, because the ambient is being consumed inside the default value it looks like we are not correctly generating the code / observing changes to this ambient, so when we go to compare parameters, (my assumption is that) we see that no parameters have changed, and hence do not recompose.
The workaround is explicitly adding the `+ambient` consumption to the function body, and not in the default value, but then this defeats the point of default values. This currently causes smaller components that contain only comparable parameters, such as ProgressIndicators, to not recompose when the colour in the theme changes.