Hello, would anyone know why an inline reified fun...
# compiler
j
Hello, would anyone know why an inline reified function in a kmp android aar would result in the stub being used instead of the actual method body and giving this error:
Copy code
This function has a reified type parameter and thus can only be inlined at compilation time, not called directly.
KMP function is pretty bland and is in the final binary classes:
Copy code
@ServiceLocatorMarker
@HiddenFromObjC
@CompanyInternalApi
@JvmSynthetic
public inline fun <reified T> ServiceLocator.getOrNull(qualifier: ServiceQualifier? = null): T? =
    if (qualifier != null) {
        getServiceOrNull(qualifier, T::class)
    } else {
        getServiceOrNull(T::class)
    }
i
Hi! This could be the case if the inline method is called via reflection instead of being called directly. I don't know about any specifics regarding kmp or android that could affect this otherwise. If you consider it a bug, please create a minimal reproducer and file an issue. This way it also would be easier to analyse the problem.
j
Thanks! I was able to solve it. Its an R8 issue. I updated to the latest R8 (we are still on agp 8 ) and the issue went away.
kodee happy 1