Unsubscript the context (when walking a subscripted expression.

This commit is contained in:
Adam Sampson 2008-04-06 18:43:34 +00:00
parent 2d15eb800c
commit 71d8c7024b

View File

@ -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.