Nick
06/05/2023, 6:10 PMIconButton(onClick = navigator::popBackStack)
where navigator.popBackStack is:
val popBackStack: () -> Unit
however, this works:
IconButton(onClick = navigator.popBackstack)
ephemient
06/05/2023, 6:18 PMval popBackStack
, then ::popBackStack
is a reference to the val, but you want the valueephemient
06/05/2023, 6:19 PMfun popBackStack()
then you'd want ::popBackStack
but you don'tNick
06/05/2023, 6:20 PMephemient
06/05/2023, 6:20 PMephemient
06/05/2023, 6:24 PMephemient
06/05/2023, 6:24 PMephemient
06/05/2023, 6:26 PMfun popBackStack()
, there is no value named popBackStack
. the only way to use it is by a function call popBackStack()
or reference ::popBackStack
ephemient
06/05/2023, 6:27 PMval popBackStack
, there is a value named popBackStack
, not a function. Kotlin lets you write popBackStack()
as a shortcut for popBackStack.invoke()
Nick
06/05/2023, 6:34 PM