This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Description
If you modify BackstackTransitionsTest.assertTransition to build its backstacks out of Map<Int, String>, like so, you crash with NoSuchElementException when popping. We're popping to a list that no longer includes the information to paint the outgoing screen, which is a pretty realistic situation.
val firstBackstack = mapOf(1 to "one")
val secondBackstack = mapOf(1 to "one", 2 to "two")
var backstack by mutableStateOf(if (forward) firstBackstack else secondBackstack)
compose.mainClock.autoAdvance = false
compose.setContent {
Backstack(
backstack.keys.toList(),
frameController = rememberTransitionController(
animationSpec = animation,
transition = transition
)
) { BasicText(backstack.getValue(it)) }
}