}
}
Set<Declaration> valueSet = new HashSet<Declaration>();
for (Tree.BaseMemberExpression bme: that.getBaseMemberExpressions()) {
ProducedType type = bme.getTypeModel();
Declaration d = bme.getDeclaration();
if (d!=null && !valueSet.add(d)) {
//this error is not really truly necessary
bme.addError("duplicate case: '" +
d.getName(unit) +
"' of '" + td.getName() + "'");
}
if (d!=null && type!=null &&
!type.getDeclaration().isAnonymous()) {
bme.addError("case must be a toplevel anonymous class: '" +
d.getName(unit) + "' is not an anonymous class");
}
else if (d!=null && !d.isToplevel()) {
bme.addError("case must be a toplevel anonymous class: '" +
d.getName(unit) + "' is not toplevel");
}
if (type!=null) {
if (checkDirectSubtype(td, bme, type)) {
checkAssignable(type, td.getType(), bme,
getCaseTypeExplanation(td, type));