619 a = types.upperBound(a); |
619 a = types.upperBound(a); |
620 return types.isSubtype(a, bound); |
620 return types.isSubtype(a, bound); |
621 } else if (a.isExtendsBound()) { |
621 } else if (a.isExtendsBound()) { |
622 return types.isCastable(bound, types.upperBound(a), types.noWarnings); |
622 return types.isCastable(bound, types.upperBound(a), types.noWarnings); |
623 } else if (a.isSuperBound()) { |
623 } else if (a.isSuperBound()) { |
624 return !types.notSoftSubtype(types.lowerBound(a), bound); |
624 return !types.notSoftSubtype(types.wildLowerBound(a), bound); |
625 } |
625 } |
626 return true; |
626 return true; |
627 } |
627 } |
628 |
628 |
629 /** Check that type is different from 'void'. |
629 /** Check that type is different from 'void'. |
2683 void validateAnnotationType(DiagnosticPosition pos, Type type) { |
2683 void validateAnnotationType(DiagnosticPosition pos, Type type) { |
2684 if (type.isPrimitive()) return; |
2684 if (type.isPrimitive()) return; |
2685 if (types.isSameType(type, syms.stringType)) return; |
2685 if (types.isSameType(type, syms.stringType)) return; |
2686 if ((type.tsym.flags() & Flags.ENUM) != 0) return; |
2686 if ((type.tsym.flags() & Flags.ENUM) != 0) return; |
2687 if ((type.tsym.flags() & Flags.ANNOTATION) != 0) return; |
2687 if ((type.tsym.flags() & Flags.ANNOTATION) != 0) return; |
2688 if (types.lowerBound(type).tsym == syms.classType.tsym) return; |
2688 if (types.cvarLowerBound(type).tsym == syms.classType.tsym) return; |
2689 if (types.isArray(type) && !types.isArray(types.elemtype(type))) { |
2689 if (types.isArray(type) && !types.isArray(types.elemtype(type))) { |
2690 validateAnnotationType(pos, types.elemtype(type)); |
2690 validateAnnotationType(pos, types.elemtype(type)); |
2691 return; |
2691 return; |
2692 } |
2692 } |
2693 log.error(pos, "invalid.annotation.member.type"); |
2693 log.error(pos, "invalid.annotation.member.type"); |