Add an Infer type to mark types that should be inferred.

We can then check it's been removed using a property later.
This commit is contained in:
Adam Sampson 2008-04-04 12:09:33 +00:00
parent 17702401fa
commit e52b51b050
2 changed files with 4 additions and 0 deletions

View File

@ -225,6 +225,7 @@ instance ShowOccam A.Type where
showOccamM A.Any = tell ["ANY"]
showOccamM (A.Timer _) = tell ["TIMER"]
showOccamM A.Time = tell ["TIME"]
showOccamM A.Infer = tell ["(inferred type)"]
showOccamM (A.Mobile t) = tell ["MOBILE "] >> showOccamM t
showOccamM (A.Array ds t)
@ -266,6 +267,7 @@ instance ShowRain A.Type where
-- Mobility is not explicit in Rain:
showRainM (A.Mobile t) = showRainM t
showRainM (A.List t) = tell ["["] >> showRainM t >> tell ["]"]
showRainM A.Infer = tell ["(inferred type)"]
showRainM x = tell ["<invalid Rain type: ", show x, ">"]
instance ShowOccam A.DyadicOp where

View File

@ -143,6 +143,8 @@ data Type =
| Time
| Port Type
| Mobile Type
-- | A type that will be inferred automatically by a pass.
| Infer
deriving (Show, Eq, Typeable, Data)
-- | An array dimension.