Fixed some problems with DATA TYPEs that were actually MOBILE stuff not being resolved at the right points
This commit is contained in:
parent
47d565a3b9
commit
5534d1c3d6
|
@ -252,10 +252,10 @@ typeOfVariable (A.Variable m n) = typeOfName n
|
|||
typeOfVariable (A.SubscriptedVariable m s v)
|
||||
= typeOfVariable v >>= subscriptType s
|
||||
typeOfVariable (A.DerefVariable m v)
|
||||
= do t <- typeOfVariable v
|
||||
= do t <- typeOfVariable v >>= resolveUserType m
|
||||
case t of
|
||||
A.Mobile innerT -> return innerT
|
||||
_ -> dieP m $ "Dereference applied to non-mobile variable"
|
||||
_ -> diePC m $ formatCode "Dereference applied to non-mobile variable of type %" t
|
||||
typeOfVariable (A.DirectedVariable m dir v)
|
||||
= do t <- typeOfVariable v
|
||||
case t of
|
||||
|
|
|
@ -27,6 +27,7 @@ import Data.Generics
|
|||
import Data.List
|
||||
import qualified Data.Map as Map
|
||||
import Data.Maybe
|
||||
import qualified Data.Traversable as T
|
||||
|
||||
import qualified AST as A
|
||||
import CompState
|
||||
|
@ -696,7 +697,7 @@ inferTypes = occamOnlyPass "Infer types"
|
|||
-- FIXME: AllocMobile
|
||||
|
||||
A.ExprVariable m v ->
|
||||
do ctx <- getTypeContext
|
||||
do ctx <- getTypeContext >>= (T.sequence . fmap (underlyingType m))
|
||||
v' <- recurse v
|
||||
t <- astTypeOf v' >>= underlyingType m
|
||||
case (ctx, t) of
|
||||
|
@ -1106,7 +1107,7 @@ inferTypes = occamOnlyPass "Infer types"
|
|||
return $ A.SubscriptedVariable m s' v''
|
||||
doVariable v
|
||||
= do v' <- descend v
|
||||
ctx <- getTypeContext
|
||||
ctx <- getTypeContext >>= (T.sequence . fmap (underlyingType (findMeta v)))
|
||||
underT <- astTypeOf v' >>= resolveUserType (findMeta v)
|
||||
case (ctx, underT) of
|
||||
(Just (A.Mobile {}), A.Mobile {}) -> return v'
|
||||
|
@ -1290,7 +1291,7 @@ checkVariables = checkDepthM doVariable
|
|||
= do t <- astTypeOf v >>= resolveUserType m
|
||||
case t of
|
||||
A.Mobile _ -> ok
|
||||
_ -> dieP m $ "Dereference applied to non-mobile variable"
|
||||
_ -> diePC m $ formatCode "Dereference applied to non-mobile variable of type %" t
|
||||
doVariable _ = ok
|
||||
|
||||
--}}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user