exitScope(o);
}
@Override
public void visit(Tree.AttributeDeclaration that) {
Value v = new Value();
that.setDeclarationModel(v);
v.setTransient(that.getSpecifierOrInitializerExpression()
instanceof Tree.LazySpecifierExpression);
visitDeclaration(that, v);
super.visit(that);
if (v.isInterfaceMember() && !v.isFormal() && !v.isNative()) {
if (that.getSpecifierOrInitializerExpression()==null) {
that.addError("interface attribute must be annotated formal", 1400);
}
/*else {
that.addError("interfaces may not have simple attributes");
}*/
}
if (v.isLate()) {
if (v.isFormal()) {
that.addError("formal attribute may not be annotated late");
}
else if (!v.isClassOrInterfaceMember() && !v.isToplevel()) {
that.addError("block-local value may not be annotated late");
}
}
Tree.SpecifierOrInitializerExpression sie = that.getSpecifierOrInitializerExpression();
if ( v.isFormal() && sie!=null ) {
that.addError("formal attributes may not have a value", 1307);
}
Tree.Type type = that.getType();
if (type instanceof Tree.ValueModifier) {
if (v.isToplevel()) {
if (sie==null) {
type.addError("toplevel values must explicitly specify a type");
}
else {
type.addError("toplevel value must explicitly specify a type", 200);
}
}
else if (v.isShared()) {
type.addError("shared value must explicitly specify a type", 200);
}
}
}