From 8c9f9e70d7ded01948f300c97cbdf586677982b3 Mon Sep 17 00:00:00 2001 From: Xun Yang <x299yang@uwaterloo.ca> Date: Fri, 6 Mar 2020 22:21:46 -0500 Subject: [PATCH] static this --- MemberNodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MemberNodes.py b/MemberNodes.py index 8245cfb..872a646 100644 --- a/MemberNodes.py +++ b/MemberNodes.py @@ -143,7 +143,7 @@ class MethodNode(ASTNode): if 'static' in self.mods: names = getNameNodes(self.body) for n in names: - if n.pointToThis and n.prefixLink.__class__.__name__ in ['MethodNode', 'FieldNode'] and 'static' not in n.prefixLink.mods: + if 'this' in n.name or (n.pointToThis and n.prefixLink.__class__.__name__ == ['MethodNode', 'FieldNode'] and 'static' not in n.prefixLink.mods): raise Exception("ERROR: Cannot use non-static member {} in static method {} in class {}".format(n.name, self.name, self.typeName)) # With method body -- GitLab