/** * Creates a new complete constructor {@code ATixeStmtAlternative} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param patternBind_ the {@link ADefPatternBind} node for the {@code patternBind} child of this {@link ATixeStmtAlternative} node * @param statement_ the {@link PStm} node for the {@code statement} child of this {@link ATixeStmtAlternative} node * @param exp_ the {@link PType} <b>graph</a> node for the {@code exp} child of this {@link ATixeStmtAlternative} node. * <i>The parent of this {@code exp } will not be changed by adding it to this node.</i> */ public ATixeStmtAlternative(ADefPatternBind patternBind_, PStm statement_, PType exp_) { super(); this.setPatternBind(patternBind_); this.setStatement(statement_); this.setExp(exp_); }
@Override public PType caseATixeStm(ATixeStm node, TypeCheckInfo question) throws AnalysisException { PType rt = node.getBody().apply(THIS, question); PTypeSet extypes = exitCheck(node.getBody(), question); if (!extypes.isEmpty()) { PType union = extypes.getType(node.getLocation()); for (ATixeStmtAlternative tsa : node.getTraps()) { tsa.setExp(union); tsa.apply(THIS, question); } } node.setType(rt); return rt; }