From c28a1cc9d206bdde41a621b018c01980b3c8a617 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Thu, 25 Apr 2024 12:58:10 -0600 Subject: Rewrote Symbol Table to be more context aware and avoid collisions --- st/ClassInstance.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'st/ClassInstance.java') diff --git a/st/ClassInstance.java b/st/ClassInstance.java index e93d3bd..8394a2c 100644 --- a/st/ClassInstance.java +++ b/st/ClassInstance.java @@ -13,6 +13,12 @@ public class ClassInstance extends AbstractInstance { this.mtds = new ArrayList<>(); } + public boolean equals(Object other) { + ClassInstance o; + return (other instanceof ClassInstance && + ((o = (ClassInstance) other).getName() == this.getName())); + } + public ClassInstance getExtend() { /** * Returns the parent class, or -- cgit v1.2.3