@Override
public PType caseAForAllStm(AForAllStm node, TypeCheckInfo question)
throws AnalysisException
{
node.setType(node.getSet().apply(THIS, question));
question.assistantFactory.createPPatternAssistant().typeResolve(node.getPattern(), THIS, question);
if (question.assistantFactory.createPTypeAssistant().isSet(node.getType()))
{
SSetType st = question.assistantFactory.createPTypeAssistant().getSet(node.getType());
List<PDefinition> defs = question.assistantFactory.createPPatternAssistant().getDefinitions(node.getPattern(), st.getSetof(), NameScope.LOCAL);
Environment local = new FlatCheckedEnvironment(question.assistantFactory, defs, question.env, question.scope);
PType rt = node.getStatement().apply(THIS, new TypeCheckInfo(question.assistantFactory, local, question.scope));
local.unusedCheck();
node.setType(rt);
return rt;
} else
{
TypeCheckerErrors.report(3219, "For all statement does not contain a set type", node.getLocation(), node);
node.setType(AstFactory.newAUnknownType(node.getLocation()));
return node.getType();
}
}