Status Update
Comments
[Deleted User] <[Deleted User]> #2
as...@google.com <as...@google.com> #3
Branch: androidx-main
commit e7b4b06e67951ab47157d06ff314a5c8b2e8fdc6
Author: Andrei Shikov <ashikov@google.com>
Date: Mon Jan 08 15:54:51 2024
Count recursive local declarations as captures
Local declarations were already counted as captures for composable lambdas before, but the traversal ordering missed the recursive captures, converting some of them into singletons.
Test: Compiler test
Fixes: 318745941
Change-Id: I9097d1be71fb67b73e5027f723fd187c4272f6b4
M compose/compiler/compiler-hosted/integration-tests/src/androidUnitTest/kotlin/androidx/compose/compiler/plugins/kotlin/ComposeBytecodeCodegenTest.kt
M compose/compiler/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/AbstractCodegenTest.kt
M compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerLambdaMemoization.kt
[Deleted User] <[Deleted User]> #4
[Deleted User] <[Deleted User]> #5
[Deleted User] <[Deleted User]> #6
It failed while compiling the project in run mode, not in the debugger
as...@google.com <as...@google.com> #7
Could you isolate the crash into a separate project? This stacktrace doesn't provide that much info, unfortunately.
[Deleted User] <[Deleted User]> #8
Was trying to reproduce it, but the problem was that I didn't know why it was failing, and I couldn't find the reason to reproduce it in a separate project. As per
From the ticket setting registry option will fix the issue, but where to add?
[Deleted User] <[Deleted User]> #9
The problem is for everyone it is for debugging, but we can't able to compile the project it self
as...@google.com <as...@google.com> #10
The ticket you are referring to is discussing expression evaluation broken in debugger. This should not affect your build.
as...@google.com <as...@google.com> #11
By any chance, could you share a file that fails to compile?
The compiler fails to process @Composable annotation somewhere in the file which causes a crash. I am not sure why this annotation is not complete, but an example could help to look for culprit.
as...@google.com <as...@google.com> #12
Correction: it might have been /any/ annotation, we don't really know if it is @Composable
[Deleted User] <[Deleted User]> #13
This is the class affected
class ReturningProfileObViewModel(application: Application) : NewProfileOBViewModel(application) {
private val returningUserRepo: ReturningUserRepository by koin.inject()
private var screens: Array<Int>? = null
fun setScreens(list: List<String>?) {
screens = returningUserRepo.getScreens(list)
}
override fun getScreenList(): Array<Int> = screens ?: emptyArray()
override fun checkAndInitViewModel(): Int {
val screen = screens?.first() ?: NewProfileOBScreen.NO_MORE_SCREEN
if (screen != NewProfileOBScreen.NO_MORE_SCREEN) {
currentScreenLiveData.value = screen
}
return screen
}
}
Here NewProfileOBScreen is an annotation
class
and the NewProfileOBViewModel
is open class ViewModel
This file doesn't use and composable functions, nor does the activity that is called. Even the whole particular package is not using composable at all
[Deleted User] <[Deleted User]> #14
This file doesn't use and composable functions
-> typo(and) This file doesn't use any composable functions
as...@google.com <as...@google.com> #15
This is interesting, judging by the stacktrace it fails when processing annotation on Class -> Super function -> Return type
None of the return types in the class are annotated though, which is weird.
as...@google.com <as...@google.com> #16
Repro:
@Target(AnnotationTarget.TYPE)
annotation class Type
interface NewProfileOBViewModel {
fun overrideMe(): @Type Int
}
class ReturningProfileObViewModel : NewProfileOBViewModel {
override fun overrideMe(): Int = 0
}
as...@google.com <as...@google.com> #17
You can workaround by removing annotation for now. (I assume NewProfileOBScreen
is an IntDef
annotation that is applied somewhere in parent)
[Deleted User] <[Deleted User]> #18
[Deleted User] <[Deleted User]> #19
Yes it is an IntDef, will try this workaround and come back
[Deleted User] <[Deleted User]> #20
[Deleted User] <[Deleted User]> #22
Removing the annotation working thanks,
ap...@google.com <ap...@google.com> #23
Branch: androidx-main
commit 2495d2c92c9ed8f63bf98c9886f122b38453036c
Author: Andrei Shikov <ashikov@google.com>
Date: Tue Nov 07 08:38:02 2023
Fix crash during overridden composable types lookup
Some annotations defined in current module can be in partially incomplete state (either completely unbound or parent is missing). When we lookup overriden functions to potentially update them, it results in a crash.
Practically, we only need to update functions in a different module, as deep copy already changes functions in the current one, so this change does exactly that.
Relnote: "Fixes a crash during lookup of overridden composable types"
Test: Compiler transform tests
Fixes: 297665426
Change-Id: Ib6d2c0ec3e18716f345a61b4df465cb64d268fec
M compose/compiler/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/FunctionBodySkippingTransformTests.kt
A compose/compiler/compiler-hosted/integration-tests/src/test/resources/golden/androidx.compose.compiler.plugins.kotlin.FunctionBodySkippingTransformTestsNoSource/testComposable[useFir = false].txt
A compose/compiler/compiler-hosted/integration-tests/src/test/resources/golden/androidx.compose.compiler.plugins.kotlin.FunctionBodySkippingTransformTestsNoSource/testComposable[useFir = true].txt
M compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposeFqNames.kt
M compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableTypeRemapper.kt
pr...@google.com <pr...@google.com> #24
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.compiler:compiler-hosted:1.5.5
Description
Jetpack Compose version: 1.5.0 Jetpack Compose component used: null Android Studio Build: AI-223.8836.35.2231.10406996 Kotlin version: 1.9.0
After upgrading the compose compiler to 1.5.2 with bom version 2023.08.00 project not compiling. With 1.5.1 it working fine. The mentioned file doesn't have any
lateinit
property. Haveby
delegatedkoin
injection onlyStack trace (if applicable):