Fixed various small mobile typing issues

This commit is contained in:
Neil Brown 2009-04-09 17:05:16 +00:00
parent 229f2197af
commit 92c92a3f65
3 changed files with 9 additions and 1 deletions

View File

@ -124,6 +124,13 @@ evalVariable (A.VariableSizes m v)
A.UnknownDimension ->
throwError (Just m, "Unknown dimension")
| d <- ds] >>* OccArray
A.Mobile (A.Array ds _)
-> sequence [case d of
A.Dimension e -> evalExpression e
A.UnknownDimension ->
throwError (Just m, "Unknown dimension")
| d <- ds] >>* OccArray
_ -> throwError (Just m, " variable not array")

View File

@ -275,6 +275,7 @@ typeOfVariable (A.VariableSizes m v)
= do t <- typeOfVariable v
case t of
A.Array ds _ -> return $ A.Array [A.Dimension $ makeConstant m $ length ds] A.Int
A.Mobile (A.Array ds _) -> return $ A.Array [A.Dimension $ makeConstant m $ length ds] A.Int
_ -> diePC m $ formatCode "Attempted to get size of non-array: % (type: %)" v t
-- | Get the abbreviation mode of a variable.

View File

@ -1007,7 +1007,7 @@ inferTypes = occamOnlyPass "Infer types"
doProcess p
= case p of
A.Assign m vs el ->
do vs' <- recurse vs
do vs' <- noTypeContext $ recurse vs
ts <- mapM astTypeOf vs'
el' <- doExpressionList ts el
return $ A.Assign m vs' el'