Fixed typeOfSpec to use the recorded type rather than trying to dig it out of the inner expression/variable

This commit is contained in:
Neil Brown 2008-02-29 16:33:33 +00:00
parent 9ab6cbc0b4
commit f5022228ba

View File

@ -72,9 +72,9 @@ typeOfSpec :: (CSMR m, Die m) => A.SpecType -> m (Maybe A.Type)
typeOfSpec st
= case st of
A.Declaration _ t _ -> return $ Just t
A.Is _ _ _ v -> (liftM Just) (typeOfVariable v)
A.IsExpr _ _ _ e -> (liftM Just) (typeOfExpression e)
A.IsChannelArray _ _ (c:_) -> liftM (Just . (A.Array [A.UnknownDimension])) $ typeOfVariable c
A.Is _ _ t _ -> return $ Just t
A.IsExpr _ _ t _ -> return $ Just t
A.IsChannelArray _ t _ -> return $ Just t
A.Retypes _ _ t _ -> return $ Just t
A.RetypesExpr _ _ t _ -> return $ Just t
_ -> return Nothing