}
// A ctor's name is apparent in its scope, unlike a fn declarations name
// which is apparent in the containing scope.
n.getAttributes().set(SCOPE, scope);
} else if (n instanceof CatchStmt) {
CatchStmt cs = (CatchStmt) n;
scope = new ScopeInfo(scope, Scope.fromCatchStmt(scope.s, cs));
// Normally, declaration in a catch block are hoisted to the parent.
// Since the logic below does that, make sure that the exception
// declaration is not hoisted.
scope.decls.add(AncestorChain.instance(ac, cs.getException()));
cs.getException().getAttributes().set(SCOPE, scope);
// And recurse to the body manually so as to avoid recursing to the
// exception declaration.
attachScopes(AncestorChain.instance(ac, cs.getBody()), scope);
return false;
} else if (n instanceof Reference) {
Reference r = (Reference) n;
String rName = r.getIdentifierName();
Scope definingScope = scope.s.thatDefines(rName);