/** Visitor method: attribute a tree, catching any completion failure * exceptions. Return the tree's type. * * @param tree The tree to be visited. * @param env The environment visitor argument. * @param pkind The protokind visitor argument. * @param pt The prototype visitor argument. */ Type attribTree(JCTree tree, Env<AttrContext> env, int pkind, Type pt) { Env<AttrContext> prevEnv = this.env; int prevPkind = this.pkind; Type prevPt = this.pt; try { this.env = env; this.pkind = pkind; this.pt = pt; tree.accept(this); if (tree == breakTree) throw new BreakAttr(env); return result; } catch (CompletionFailure ex) { tree.type = syms.errType; return chk.completionError(tree.pos(), ex); } finally { this.env = prevEnv; this.pkind = prevPkind; this.pt = prevPt; } }
/** Visitor method: attribute a tree, catching any completion failure * exceptions. Return the tree's type. * * @param tree The tree to be visited. * @param env The environment visitor argument. * @param resultInfo The result info visitor argument. */ Type attribTree(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) { Env<AttrContext> prevEnv = this.env; ResultInfo prevResult = this.resultInfo; try { this.env = env; this.resultInfo = resultInfo; tree.accept(this); if (tree == breakTree && resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) { throw new BreakAttr(copyEnv(env)); } return result; } catch (CompletionFailure ex) { tree.type = syms.errType; return chk.completionError(tree.pos(), ex); } finally { this.env = prevEnv; this.resultInfo = prevResult; } }
/** Visitor method: attribute a tree, catching any completion failure * exceptions. Return the tree's type. * * @param tree The tree to be visited. * @param env The environment visitor argument. * @param pkind The protokind visitor argument. * @param pt The prototype visitor argument. */ Type attribTree(JCTree tree, Env<AttrContext> env, int pkind, Type pt) { Env<AttrContext> prevEnv = this.env; int prevPkind = this.pkind; Type prevPt = this.pt; try { this.env = env; this.pkind = pkind; this.pt = pt; tree.accept(this); if (tree == breakTree) throw new BreakAttr(env); return result; } catch (CompletionFailure ex) { tree.type = syms.errType; return chk.completionError(tree.pos(), ex); } finally { this.env = prevEnv; this.pkind = prevPkind; this.pt = prevPt; } }
/** Visitor method: attribute a tree, catching any completion failure * exceptions. Return the tree's type. * * @param tree The tree to be visited. * @param env The environment visitor argument. * @param resultInfo The result info visitor argument. */ Type attribTree(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) { Env<AttrContext> prevEnv = this.env; ResultInfo prevResult = this.resultInfo; try { this.env = env; this.resultInfo = resultInfo; tree.accept(this); if (tree == breakTree && resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) { throw new BreakAttr(copyEnv(env)); } return result; } catch (CompletionFailure ex) { tree.type = syms.errType; return chk.completionError(tree.pos(), ex); } finally { this.env = prevEnv; this.resultInfo = prevResult; } }