Skip to content

Instantly share code, notes, and snippets.

@takahirom
Last active March 1, 2022 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takahirom/394c902663e1a16be7a6c4e79316ed15 to your computer and use it in GitHub Desktop.
Save takahirom/394c902663e1a16be7a6c4e79316ed15 to your computer and use it in GitHub Desktop.
@RequiresOptIn(message = "AmazingFeature should be checked")
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
annotation class AmazingFeature
@AmazingFeature
fun brokenAmazingFeature() {
TODO("aaaaa")
}
class HogeActivity {
fun onClick() {
brokenAmazingFeature() // Compile-time errors will be displayed!!!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment