title: Are java annotations with typed class parameter possible?
body: <p>Let's supposed i have this interface: </p>
  
  <pre><code>public interface MyInterface {
     void doStuff();
  }
  </code></pre>
  
  <p>With a concrete implementation:</p>
  
  <pre><code>public class HardCoreConcrete implements MyInterface {
     void doStuff() {
        // i really do stuff, honest
     }
  }
  </code></pre>
  
  <p>And suppose i have this annotation:</p>
  
  <pre><code>@Target(ElementType.class)
  @Retention(RetentionPolicy.RUNTIME)
  public @interface MyAnnotation {
     Class&lt;MyInterface&gt; clazz;
  }
  </code></pre>
  
  <p>It would be used like this:</p>
  
  <pre><code>@MyAnnotation(clazz = HardCoreConcrete.class)
  public class SomeOtherClass {
  ...
  }
  </code></pre>
  
  <p>Why does this not work? My compiler complains that for clazz it expected type MyInterface! But HardCoreConcrete implements MyInterface.</p>
  
  <p>Am I doing something wrong? Is this not allowed? Am i out of luck?</p>