diff options
Diffstat (limited to 'heat')
-rw-r--r-- | heat/HeatVisitor.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/heat/HeatVisitor.java b/heat/HeatVisitor.java index 584eaec..04ba0f4 100644 --- a/heat/HeatVisitor.java +++ b/heat/HeatVisitor.java @@ -464,13 +464,15 @@ public class HeatVisitor extends GJDepthFirst<TypeBundle,String> { n.getClass().getSimpleName())); /////////////////////////////////////////////////////////////// TypeInstance t = this.symt.getType(id); + if (t == null) + t = this.symt.getTypeAttr(id); if (t == null || t.getType() != TypeEnum.intarray) throw new TypecheckException(String.format("%s called on non-array!", n.getClass().getSimpleName())); TypeBundle tb = n.f2.accept(this, argu); _ret = n.f5.accept(this, argu); - if (!tb.isInt() || _ret.isInt()) + if (!tb.isInt() || !_ret.isInt()) throw new TypecheckException(String.format("%s tried with something other than an integer!", n.getClass().getSimpleName())); /////////////////////////////////////////////////////////////// @@ -919,6 +921,8 @@ public class HeatVisitor extends GJDepthFirst<TypeBundle,String> { n.getClass().getSimpleName())); /////////////////////////////////////////////////////////////// TypeInstance t = this.symt.getType(n.f0.tokenImage); + if (t == null) + t = this.symt.getTypeAttr(n.f0.tokenImage); _ret = new TypeBundle(t.getType(), t.getClassInstance()); /////////////////////////////////////////////////////////////// MinimalLogger.info(String.format("<- %s with %s", |