Fixed various small mobile typing issues
This commit is contained in:
parent
229f2197af
commit
92c92a3f65
|
@ -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")
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue
Block a user