From a1585c74a9dfd1af40f3b07ee4da6289e444f760 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 11 Feb 2009 11:53:04 +0000 Subject: [PATCH] Fixed inferTypes so that it again handles Specifications in Structured ExpressionList in function definitions --- frontends/OccamTypes.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontends/OccamTypes.hs b/frontends/OccamTypes.hs index dc33791..328e4e9 100644 --- a/frontends/OccamTypes.hs +++ b/frontends/OccamTypes.hs @@ -898,10 +898,11 @@ inferTypes = occamOnlyPass "Infer types" -- (This can go away once we represent all functions in the new Process -- form.) doFuncDef :: [A.Type] -> Transform (A.Structured A.ExpressionList) - doFuncDef ts (A.Spec m spec s) - = do spec' <- recurse spec + doFuncDef ts (A.Spec m (A.Specification m' n st) s) + = do st' <- runReaderT (doSpecType n st) s + modifyName n (\nd -> nd { A.ndSpecType = st' }) s' <- doFuncDef ts s - return $ A.Spec m spec' s' + return $ A.Spec m (A.Specification m' n st') s' doFuncDef ts (A.ProcThen m p s) = do p' <- recurse p s' <- doFuncDef ts s