From 5388a91e2a8465fbd9049b360a7bea04526f0414 Mon Sep 17 00:00:00 2001
From: Xun Yang <x299yang@uwaterloo.ca>
Date: Fri, 6 Mar 2020 15:14:56 -0500
Subject: [PATCH] fix getting method of local var

---
 NameNode.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/NameNode.py b/NameNode.py
index 7927507..19a6368 100644
--- a/NameNode.py
+++ b/NameNode.py
@@ -173,7 +173,7 @@ class NameNode(ASTNode):
             while self.IDs:
                 if len(self.IDs) == 1:
                     if self.methodInvoke:
-                        if curType.__class__.__name__ == 'ParamNode':
+                        if curType.__class__.__name__ in ['ParamNode', 'VarDclNode']:
                             curType = curType.myType.typePointer
                         curType = curType.env.getNode(self.IDs[0], 'method')
                         self.methodName = self.IDs[0]
-- 
GitLab