if (tal!=null) {
List<Tree.Type> args = tal.getTypes();
for (int i = 0; i<args.size(); i++) {
Tree.Type t = args.get(i);
if (t instanceof Tree.StaticType) {
TypeVariance variance =
((Tree.StaticType) t).getTypeVariance();
if (variance!=null) {
TypeParameter p = params.get(i);
if (p.isInvariant()) {
if (variance.getText().equals("out")) {
pt.setVariance(p, OUT);
}
else if (variance.getText().equals("in")) {
pt.setVariance(p, IN);
}
}
else {
variance.addError("type parameter is not declared invariant: '" +
p.getName() + "' of '" + type.getName(unit) + "'");
}
}
}
}