This is the error I get when using custom annotation in a higher-order function:
Is there any way to use annotations in higher-order functions? If not, what would be an alternative solution (apart from using enums)?
This is how my custom annotation looks like:
companion object {
private const val PERMISSION_DENIED = 1
private const val PROVIDER_DISABLED = 2
private const val SUCCESS = 3
@IntDef(PERMISSION_DENIED, PROVIDER_DISABLED, SUCCESS)
@Retention(AnnotationRetention.SOURCE)
annotation class PreconditionResult
}
