Have method references stopped working? I'm trying...
# compose
i
Have method references stopped working? I'm trying to pass an @Composable function via method reference, and it fails to run (or compile, depending on how I define the withView function):
io.khimera.example.weather.SplashScreenViewModelKt$splashScreenRouter$1$1 cannot be cast to kotlin.jvm.functions.Function2
Copy code
fun <T> withView(view: T) where T:(@Composable() (VM) -> Unit)  {
        if (this.view != null) throw IllegalStateException("Route already has view")
        this.view = view
    }

...
withView(::SplashScreen)
r
The composer is now passed as an argument to composable fonctions. It's probably what's causing this error.
l
yes. this is a bug currently and will be fixed eventually but this particular case is a bit challenging. In the interim you can use lambda syntax