Skip to content

Commit

Permalink
Correct TypeCheckInfo constraints when checking annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbattle committed Feb 15, 2019
1 parent 70810dc commit 78d5822
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3024,10 +3024,11 @@ else if (question.assistantFactory.createPTypeAssistant().isType(node.getLeft().
public PType caseAAnnotatedUnaryExp(AAnnotatedUnaryExp node, TypeCheckInfo question)
throws AnalysisException
{
node.getAnnotation().apply(THIS, question); // check the annotation itself first?
beforeAnnotation(node.getAnnotation(), node, question);
TypeCheckInfo unconstrained = question.newConstraint(null);
node.getAnnotation().apply(THIS, unconstrained); // check the annotation itself first?
beforeAnnotation(node.getAnnotation(), node, unconstrained);
PType result = node.getExp().apply(THIS, question);
afterAnnotation(node.getAnnotation(), node, question);
afterAnnotation(node.getAnnotation(), node, unconstrained);
node.setType(result);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,11 @@ public PType caseAAlwaysStm(AAlwaysStm node, TypeCheckInfo question)
public PType caseAAnnotatedStm(AAnnotatedStm node, TypeCheckInfo question)
throws AnalysisException
{
node.getAnnotation().apply(THIS, question); // Check annotation first?
beforeAnnotation(node.getAnnotation(), node, question);
TypeCheckInfo unconstrained = question.newConstraint(null);
node.getAnnotation().apply(THIS, unconstrained); // Check annotation first?
beforeAnnotation(node.getAnnotation(), node, unconstrained);
PType result = node.getStmt().apply(THIS, question);
afterAnnotation(node.getAnnotation(), node, question);
afterAnnotation(node.getAnnotation(), node, unconstrained);
node.setType(result);
return result;
}
Expand Down

0 comments on commit 78d5822

Please sign in to comment.