Added a work-around for resolving user defined types in the CompState
This commit is contained in:
parent
8492dc03d4
commit
be36af4bf0
|
@ -23,8 +23,10 @@ module SimplifyTypes (
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad.State
|
import Control.Monad.State
|
||||||
|
import qualified Data.Traversable as T
|
||||||
|
|
||||||
import qualified AST as A
|
import qualified AST as A
|
||||||
|
import CompState
|
||||||
import Metadata
|
import Metadata
|
||||||
import Pass
|
import Pass
|
||||||
import qualified Properties as Prop
|
import qualified Properties as Prop
|
||||||
|
@ -43,9 +45,14 @@ resolveNamedTypes
|
||||||
(Prop.agg_namesDone
|
(Prop.agg_namesDone
|
||||||
++ [Prop.expressionTypesChecked, Prop.processTypesChecked])
|
++ [Prop.expressionTypesChecked, Prop.processTypesChecked])
|
||||||
[Prop.typesResolvedInAST, Prop.typesResolvedInState]
|
[Prop.typesResolvedInAST, Prop.typesResolvedInState]
|
||||||
(\t -> do get >>= resolve >>= put
|
(\t -> do get >>= resolve >>= resolve_csNames >>= put
|
||||||
resolve t)
|
resolve t)
|
||||||
where
|
where
|
||||||
|
-- Work-around for data types not being resolved:
|
||||||
|
resolve_csNames :: Transform CompState
|
||||||
|
resolve_csNames cs = do csNames' <- T.mapM resolve $ csNames cs
|
||||||
|
return $ cs { csNames = csNames' }
|
||||||
|
|
||||||
resolve :: PassType
|
resolve :: PassType
|
||||||
resolve = applyDepthM doType
|
resolve = applyDepthM doType
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in New Issue
Block a user