public boolean isFunctional() { if (isFunctional != null) { return isFunctional; } return outer == null ? false : outer.isFunctional(); }
@Override public PType caseATimeExp(ATimeExp node, TypeCheckInfo question) { PDefinition encl = question.env.getEnclosingDefinition(); if (encl != null && encl.getAccess().getPure()) { TypeCheckerErrors.report(3346, "Cannot use 'time' in pure operations", node.getLocation(), node); } if (Settings.release == Release.VDM_10 && question.env.isFunctional()) { TypeCheckerErrors.report(3348, "Cannot use 'time' in a functional context", node.getLocation(), node); } node.setType(AstFactory.newANatNumericBasicType(node.getLocation())); return question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, node.getType(), node.getLocation()); }
@Override public PType caseAThreadIdExp(AThreadIdExp node, TypeCheckInfo question) { PDefinition encl = question.env.getEnclosingDefinition(); if (encl != null && encl.getAccess().getPure()) { TypeCheckerErrors.report(3346, "Cannot use 'threadid' in pure operations", node.getLocation(), node); } if (Settings.release == Release.VDM_10 && question.env.isFunctional()) { TypeCheckerErrors.report(3348, "Cannot use 'threadid' in a functional context", node.getLocation(), node); } node.setType(AstFactory.newANatNumericBasicType(node.getLocation())); return question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, node.getType(), node.getLocation()); }
if (Settings.release == Release.VDM_10 && question.env.isFunctional())
if (question.env.isFunctional())
boolean inFunction = question.env.isFunctional(); boolean inOperation = !inFunction; boolean inReserved = (func == null || func.getName() == null) ?