Skip to content

Instantly share code, notes, and snippets.

@shiraji
Last active July 7, 2016 07:47
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 shiraji/ce20ede803d6e3e850026efa1438e76f to your computer and use it in GitHub Desktop.
Save shiraji/ce20ede803d6e3e850026efa1438e76f to your computer and use it in GitHub Desktop.
@Fancy(annotation = FooAnno())
fun foo() {
@Fancy(annotation = @FooAnno())
foo()
@Fancy2(annotation = arrayOf(FooAnno()))
foo()
@Fancy2(annotation = arrayOf(@FooAnno()))
foo()
}
}
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION,
AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION)
@Retention(AnnotationRetention.SOURCE)
annotation class Fancy(val annotation: FooAnno)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION,
AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION)
@Retention(AnnotationRetention.SOURCE)
annotation class Fancy2(val annotation: Array<FooAnno>)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION,
AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION)
@Retention(AnnotationRetention.SOURCE)
annotation class FooAnno
@Target(AnnotationTarget.EXPRESSION)
@kotlin.annotation.Retention
annotation class Foo(val value: String, val foo: String)
@shiraji
Copy link
Author

shiraji commented Jul 7, 2016

テストなどのコミット。参考にする。
shiraji/kotlin@8e5481b

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