diff --git a/voyager-core/src/commonMain/kotlin/cafe/adriel/voyager/core/registry/ScreenRegistry.kt b/voyager-core/src/commonMain/kotlin/cafe/adriel/voyager/core/registry/ScreenRegistry.kt index af99690e..b8738219 100644 --- a/voyager-core/src/commonMain/kotlin/cafe/adriel/voyager/core/registry/ScreenRegistry.kt +++ b/voyager-core/src/commonMain/kotlin/cafe/adriel/voyager/core/registry/ScreenRegistry.kt @@ -21,8 +21,9 @@ public object ScreenRegistry { factories[T::class] = factory as ScreenFactory } - public inline fun get(provider: T): Screen { - val factory = factories[T::class] ?: error("ScreenProvider not registered: ${T::class.qualifiedName}") + public fun get(provider: ScreenProvider): Screen { + val factory = factories[provider::class] + ?: error("ScreenProvider not registered: ${provider::class.qualifiedName}") return factory(provider) } }