/** * Creates a new complete constructor {@code ASeqEnumSeqExp} 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 members_ the {@link NodeList} node for the {@code members} child of this {@link ASeqEnumSeqExp} node * @param types_ the {@link GraphNodeList} <b>graph</a> node for the {@code types} child of this {@link ASeqEnumSeqExp} node. * <i>The parent of this {@code types } will not be changed by adding it to this node.</i> */ public ASeqEnumSeqExp(PType type_, ILexLocation location_, List<? extends PExp> members_, List<? extends PType> types_) { super(type_,location_); this.setMembers(members_); this.setTypes(types_); }
@Override public PType caseASeqEnumSeqExp(ASeqEnumSeqExp node, TypeCheckInfo question) throws AnalysisException { PTypeSet ts = new PTypeSet(question.assistantFactory); node.setTypes(new LinkedList<PType>()); List<PType> types = node.getTypes(); TypeCheckInfo elemConstraint = question; if (question.constraint != null && question.assistantFactory.createPTypeAssistant().isSeq(question.constraint)) { PType stype = question.assistantFactory.createPTypeAssistant().getSeq(question.constraint).getSeqof(); elemConstraint = question.newConstraint(stype); } for (PExp ex : node.getMembers()) { question.qualifiers = null; PType mt = ex.apply(THIS, elemConstraint); ts.add(mt); types.add(mt); } node.setType(ts.isEmpty() ? AstFactory.newASeqSeqType(node.getLocation()) : AstFactory.newASeq1SeqType(node.getLocation(), ts.getType(node.getLocation()))); return question.assistantFactory.createPTypeAssistant().possibleConstraint(question.constraint, node.getType(), node.getLocation()); }