From d419c89843110bd79748af2e6427297a6cbfeb5b Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 15 Apr 2009 19:37:19 +0000 Subject: [PATCH] Fixed the type-checking for the allocation of mobile arrays --- frontends/OccamTypes.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontends/OccamTypes.hs b/frontends/OccamTypes.hs index 11b3029..5dfdf08 100644 --- a/frontends/OccamTypes.hs +++ b/frontends/OccamTypes.hs @@ -347,8 +347,11 @@ checkAllocMobile m rawT me = do t <- resolveUserType m rawT case t of A.Mobile innerT -> - do case innerT of - A.Array ds _ -> ok --mapM_ (checkFullDimension m) ds + do case (innerT, me) of + -- Array dimensions must be known if there's no initialiser. + -- If there is an initialiser, we'll get the dimensions from + -- that. + (A.Array ds _, Nothing) -> mapM_ (checkFullDimension m) ds _ -> ok case me of Just e ->