diff --git a/NameNode.py b/NameNode.py
index 19a6368346c82cedb6ad0d44f7192eb65324e577..087f3f773346c21fac4e1d59cac0a49bdc150cc1 100644
--- a/NameNode.py
+++ b/NameNode.py
@@ -182,6 +182,8 @@ class NameNode(ASTNode):
                             self.myType = TypeStruct("int", None)
                             return
                         else:
+                            if curType.__class__.__name__ in ['ParamNode', 'VarDclNode']:
+                                curType = curType.myType.typePointer
                             curType = curType.env.getNode(self.IDs[0], 'fieldDcl')
                     # for methods, we want to keep prefixLink pointing to the class for getting method later
                 else: