The following code fails with the violations utils.Utils:18 Undefined reference: long Thread.threadId()
package utils
import android.os.Build
import androidx.annotation.RequiresApi
val Thread.threadIdCompat: Long
get() =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA) {
threadIdApi36
} else {
@Suppress("DEPRECATION")
id
}
@org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
inline val Thread.threadIdApi36: Long
get() = threadId()
while when I remove the inline it works fine