Hey, I'm getting some strange SlotTable issues tha...
# compose
c
Hey, I'm getting some strange SlotTable issues that are hard to narrow down the cause of. It seems to occur when there are too many .clickables but I'm not entirely sure - anyone else seen anything like this?
Copy code
Process: com.caelumforder.blah, PID: 7462
    java.lang.ArrayIndexOutOfBoundsException: length=10280; index=-1219
        at androidx.compose.runtime.SlotTableKt.isNode(SlotTable.kt:2416)
        at androidx.compose.runtime.SlotTableKt.access$isNode(Unknown Source:0)
        at androidx.compose.runtime.SlotReader.isNode(SlotTable.kt:547)
        at androidx.compose.runtime.Composer.nodeIndexOf(Composer.kt:1796)
        at androidx.compose.runtime.Composer.recomposeToGroupEnd(Composer.kt:1686)
        at androidx.compose.runtime.Composer.skipToGroupEnd(Composer.kt:1970)
        at androidx.compose.ui.layout.LayoutKt$WithConstraints$1$1$placeables$1.invoke(Layout.kt:531)
...
👀 2
t
I ran into this because I was accidentally mixing/matching alpha06/07 for the libraries
âž• 1
Also, not sure if this might be related to: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1605124287346300
âž• 1
c
Yeah I ran into that earlier but I don't think it's the cause now,
./gradlew app:dependencies | grep compose
shows only alpha07s
I commented out code until it worked and found removing a single .clickable that is relatively deeply nested fixes it, but also commenting out another clickable elsewhere fixes it 🤔 and commenting out one and adding 2 leaves it broken still
😖 1
j
@caelum19 i had a similar issue but could not provide reproduction code since it was too nested and complex. Maybe you can? (Or just send the entire project)
l
anything reproducible (even an entire app or zip that we could pull down locally) would be very helpful
c
Out of curiosity, does anyone know of an easy way to isolate code that is used from a point? Any IntelliJ Coverage related util? I feel like it's something that is useful enough that someone has already made something cool for it
d
Isolate code? There's a refactor option that can extract code into a function but I'm not sure if that's what you mean.
z
Maybe the data flow or call hierarchy views in IntelliJ?
c
Those are useful for this, but i'm wondering if there's anything that essentially runs a coverage test from an arbitrary point in the code and allows you to export all of the lines of code that are covered, because it would be super useful for sharing reproducibles by filtering out irrelevants (and in my case any secrets that may be hidden in the code blob sweat smile)