public void resetType() { def.setType(original); } }
public void qualifyType() { def.setType(type); }
@Override public PType caseABlockSimpleBlockStm(ABlockSimpleBlockStm node, TypeCheckInfo question) throws AnalysisException { // Each dcl definition is in scope for later definitions... Environment local = question.env; for (PDefinition d : node.getAssignmentDefs()) { local = new FlatCheckedEnvironment(question.assistantFactory, d, local, question.scope); // cumulative question.assistantFactory.createPDefinitionAssistant().implicitDefinitions(d, local); d.setType(question.assistantFactory.createPTypeAssistant().typeResolve(d.getType(), null, THIS, question)); d.apply(THIS, new TypeCheckInfo(question.assistantFactory, local, question.scope, question.qualifiers, d.getType(), question.returnType)); } // For type checking purposes, the definitions are treated as // local variables. At runtime (below) they have to be treated // more like (updatable) state. PType r = defaultSSimpleBlockStm(node, new TypeCheckInfo(question.assistantFactory, local, question.scope, null, null, question.returnType)); local.unusedCheck(question.env); node.setType(r); return r; }
ILexNameToken name = node.getName(); AModuleModules from = node.getFrom(); def.setType((SInvariantType) question.assistantFactory.createPTypeAssistant().typeResolve(question.assistantFactory.createPDefinitionAssistant().getType(def), null, THIS, question));