From 71d8c7024b63aa14c2e8ac257beff851c39be9f3 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Sun, 6 Apr 2008 18:43:34 +0000 Subject: [PATCH] Unsubscript the context (when walking a subscripted expression. --- frontends/OccamTypes.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontends/OccamTypes.hs b/frontends/OccamTypes.hs index 9963f29..6668f8e 100644 --- a/frontends/OccamTypes.hs +++ b/frontends/OccamTypes.hs @@ -645,7 +645,11 @@ inferTypes = applyExplicitM9 doExpression doDimension doSubscript -- FIXME: IntrinsicFunctionCall A.SubscriptedExpr m s e -> do s' <- inferTypes s - e' <- inSubscriptedContext m $ inferTypes e + ctx <- getTypeContext + ctx' <- case ctx of + Just t -> unsubscriptType s t >>* Just + Nothing -> return Nothing + e' <- inTypeContext ctx' $ inferTypes e return $ A.SubscriptedExpr m s' e' -- Other expressions don't modify the type context.