if(node.getExpType() != null && !_visitedNodes.contains(node.getExpType())) node.getExpType().apply(this);
if(node.getExpType() != null && !_visitedNodes.contains(node.getExpType())) node.getExpType().apply(this, question);
if(node.getExpType() != null && !_visitedNodes.contains(node.getExpType())) node.getExpType().apply(this);
if(node.getExpType() != null && !_visitedNodes.contains(node.getExpType())) mergeReturns(retVal,node.getExpType().apply(this));
if(node.getExpType() != null && !_visitedNodes.contains(node.getExpType())) mergeReturns(retVal,node.getExpType().apply(this, question));
@Override public IProofObligationList caseAAssignmentDefinition( AAssignmentDefinition node, IPOContextStack question) throws AnalysisException { try { IProofObligationList obligations = new ProofObligationList(); PExp expression = node.getExpression(); PType type = node.getType(); PType expType = node.getExpType(); obligations.addAll(expression.apply(rootVisitor, question)); if (!assistantFactory.getTypeComparator().isSubType(question.checkType(expression, expType), type)) { TypeCompatibilityObligation sto = TypeCompatibilityObligation.newInstance(expression, type, expType, question, assistantFactory); if (sto != null) { obligations.add(sto); } } return obligations; } catch (Exception e) { throw new POException(node, e.getMessage()); } }
@Override public PType caseAAssignmentDefinition(AAssignmentDefinition node, TypeCheckInfo question) throws AnalysisException { question.qualifiers = null; node.setType(question.assistantFactory.createPTypeAssistant().typeResolve(question.assistantFactory.createPDefinitionAssistant().getType(node), null, THIS, question)); ExcludedDefinitions.setExcluded(node); node.setExpType(node.getExpression().apply(THIS, question)); ExcludedDefinitions.clearExcluded(); question.assistantFactory.getTypeComparator().checkComposeTypes(node.getType(), question.env, false); if (node.getExpType() instanceof AVoidType) { TypeCheckerErrors.report(3048, "Expression does not return a value", node.getExpression().getLocation(), node.getExpression()); } if (!question.assistantFactory.getTypeComparator().compatible(node.getType(), node.getExpType())) { TypeCheckerErrors.report(3000, "Expression does not match declared type", node.getExpression().getLocation(), node); TypeCheckerErrors.detail2("Declared", node.getType(), "Expression", node.getExpType()); } return node.getType(); }