Skip to content

@IgnoreJRERequirement is not working for Kotlin inline fun #311

@atulgpt

Description

@atulgpt

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions