Skip to content
Snippets Groups Projects
Commit 73dd924e authored by Xun Yang's avatar Xun Yang
Browse files

fix field access extra this

parent 0230e4ab
No related branches found
No related tags found
2 merge requests!30New new string,!20Master
......@@ -117,9 +117,10 @@ class NameNode(ASTNode):
self.addToPrefix("contain")
# evaluate THIS first, fieldnode will be added to prefixNodes in checkType()
cNameNode = genNameNode(self.typeName)
cNameNode.isThis = True
self.prefixNodes.append(cNameNode)
if not self.prefixNodes:
cNameNode = genNameNode(self.typeName)
cNameNode.isThis = True
self.prefixNodes.append(cNameNode)
return True
return False
......@@ -242,7 +243,7 @@ class NameNode(ASTNode):
self.methodClass = meth.env.getNode(meth.typeName, 'type')
self.methodName = self.IDs[0]
else:
if curType.myType and curType.myType.isArray and self.IDs[0] == 'length':
self.myType = TypeStruct("int", None)
......
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