Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

reflect-lint: Support Kotlin annotations with default retention#189

Open
PhilGlass wants to merge 3 commits intoJakeWharton:masterfrom
PhilGlass:lint_kotlin
Open

reflect-lint: Support Kotlin annotations with default retention#189
PhilGlass wants to merge 3 commits intoJakeWharton:masterfrom
PhilGlass:lint_kotlin

Conversation

@PhilGlass
Copy link
Copy Markdown

The default retention for annotations written in Kotlin is RUNTIME, but dagger-reflect-lint currently flags any Kotlin annotation without an explicit @Retention(AnnotationRetention.RUNTIME) as an error.

@TWiStErRob
Copy link
Copy Markdown
Contributor

TWiStErRob commented Apr 3, 2020

Based on the kdoc you linked to me it looks like you still must put @Retention() so only annotation class X doesn't seem to have RUNTIME retention. However your claim is correct in the end, but the relevant doc here is AnnotationRetention.RUNTIME and the annotation design doc

@PhilGlass
Copy link
Copy Markdown
Author

@TWiStErRob You're right, that's the wrong documentation link. It was late!

I found another issue with AnnotationRetention.BINARY support after running this check over our codebase - I've pushed another commit that fixes it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants