If you create custom type hierarchy with subtyping checker, add polymorphic qualifier and pass to PolymorphicQualifier meta-annotation value() property class that is not top qualifier, you will get TypeSystemError that says something about bottom types, rather than that you have passed not the top qualifier. Debugging this can be quite tedious.
Example:
@DefaultQualifierInHierarchy
@SubtypeOf({})
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
public @interface root { }
@SubtypeOf({
foo.class, boo.class, goo.class
})
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
public @interface bottom { }
@SubtypeOf(root.class)
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
public @interface goo { }
@SubtypeOf(goo.class)
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
public @interface foo { }
@SubtypeOf(goo.class)
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
public @interface boo { }
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@PolymorphicQualifier(goo.class)
public @interface polygoo { }
will get you this error.
If you create custom type hierarchy with subtyping checker, add polymorphic qualifier and pass to PolymorphicQualifier meta-annotation value() property class that is not top qualifier, you will get TypeSystemError that says something about bottom types, rather than that you have passed not the top qualifier. Debugging this can be quite tedious.
Example:
will get you this error.