return list;
}
private void checkAnnotationInstantiation(Functional a, Tree.Expression e, ProducedType pt) {
if (e!=null) {
Term term = e.getTerm();
if (term instanceof Tree.InvocationExpression) {
Tree.InvocationExpression ie = (Tree.InvocationExpression) term;
/*if (!ie.getTypeModel().isExactly(pt)) {
ie.addError("annotation constructor must return exactly the annotation type");
}*/
Tree.Primary primary = ie.getPrimary();
if (!(primary instanceof Tree.BaseTypeExpression)
&& (!(primary instanceof Tree.BaseMemberExpression)
|| !((Tree.BaseMemberExpression)primary).getDeclaration().isAnnotation())) {
term.addError("annotation constructor must return a newly-instantiated annotation");
}
checkAnnotationArguments(a, ie);
}
else {
term.addError("annotation constructor must return a newly-instantiated annotation");
}
}
}