Skip to content

Instantly share code, notes, and snippets.

@raphw
Last active January 20, 2016 11:08
Show Gist options
  • Save raphw/a7f47fa09f419f588599 to your computer and use it in GitHub Desktop.
Save raphw/a7f47fa09f419f588599 to your computer and use it in GitHub Desktop.
Annotations for owner types are invers to the type navigation order.
class Foo<T> {
abstract class Bar {
// type path is not null but .
abstract void qux(@TypeAnnotation(1) Bar arg);
abstract void baz(Foo<T>.@TypeAnnotation(7) Bar arg);
}
}
@Target(Element.TYPE_USE)
@Retention(RetentionPolicy.RUNTIME)
@interface TypeAnnotation {
int value();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment