diff options
Diffstat (limited to 'st/SymbolTable.java')
-rw-r--r-- | st/SymbolTable.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/st/SymbolTable.java b/st/SymbolTable.java index 9d7ffb4..7475e5e 100644 --- a/st/SymbolTable.java +++ b/st/SymbolTable.java @@ -96,22 +96,21 @@ public class SymbolTable { public TypeInstance getType(String id) { AbstractInstance symbol; return ((symbol = this.symt.get(id)) != - null && symbol.getType() != TypeEnum.classname && - symbol.getType() != TypeEnum.method) ? + null && symbol instanceof TypeInstance) ? (TypeInstance) symbol : null; } public MethodInstance getMethod(String id) { AbstractInstance symbol; return ((symbol = this.symt.get(id)) != - null && symbol.getType() == TypeEnum.method) ? + null && symbol instanceof MethodInstance) ? (MethodInstance) symbol : null; } public ClassInstance getClass(String id) { AbstractInstance symbol; return ((symbol = this.symt.get(id)) != - null && symbol.getType() == TypeEnum.classname) ? + null && symbol instanceof ClassInstance) ? (ClassInstance) symbol : null; } |