Skip to content
Snippets Groups Projects
Commit 5e3ebb38 authored by pycsham's avatar pycsham
Browse files

fixed an issue with forNode's checkType

parent 34bcd515
No related branches found
No related tags found
2 merge requests!25Master,!20Master
......@@ -450,11 +450,14 @@ class ForNode(ASTNode):
self.children.append(self.bodyStatement)
def checkType(self):
self.forInit.checkType()
self.forBound.checkType() # need resolving var declared in forInit to use it in forBound
if self.forBound.myType.name != 'boolean':
raise Exception("ERROR: Cannot use non-boolean type for forBound.")
self.forUpdate.checkType()
if self.forInit:
self.forInit.checkType()
if self.forBound:
self.forBound.checkType() # need resolving var declared in forInit to use it in forBound
if self.forBound.myType.name != 'boolean':
raise Exception("ERROR: Cannot use non-boolean type for forBound.")
if self.forUpdate:
self.forUpdate.checkType()
self.bodyStatement.checkType()
def reachCheck(self, inMaybe):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment