@Override public PType caseASubseqExp(ASubseqExp node,
TypeCheckInfo question) throws AnalysisException
{
TypeCheckInfo noConstraint = question.newConstraint(null);
question.qualifiers = null;
PType stype = node.getSeq().apply(THIS, noConstraint);
question.qualifiers = null;
node.setFtype(node.getFrom().apply(THIS, noConstraint));
PType ftype = node.getFtype();
question.qualifiers = null;
node.setTtype(node.getTo().apply(THIS, noConstraint));
PType ttype = node.getTtype();
if (!question.assistantFactory.createPTypeAssistant().isSeq(stype))
{
TypeCheckerErrors.report(3174, "Subsequence is not of a sequence type", node.getLocation(), node);
}
question.assistantFactory.createPTypeAssistant();
if (!question.assistantFactory.createPTypeAssistant().isNumeric(ftype))
{
TypeCheckerErrors.report(3175, "Subsequence range start is not a number", node.getLocation(), node);
}
question.assistantFactory.createPTypeAssistant();
if (!question.assistantFactory.createPTypeAssistant().isNumeric(ttype))
{
TypeCheckerErrors.report(3176, "Subsequence range end is not a number", node.getLocation(), node);
}
node.setType(stype);
return stype;
}