Added marking up of types in foreach replicators for type unification
This commit is contained in:
parent
0c443255e6
commit
760c8a9a1e
|
@ -96,7 +96,7 @@ performTypeUnification x
|
|||
<.< markParamPass
|
||||
<.< markAssignmentTypes
|
||||
<.< markCommTypes
|
||||
-- TODO mark up types in replicators
|
||||
<.< markReplicators
|
||||
<.< markExpressionTypes
|
||||
$ x
|
||||
-- Then, we do the unification:
|
||||
|
@ -131,6 +131,13 @@ recordInfNameTypes = everywhereM (mkM recordInfNameTypes')
|
|||
return input
|
||||
recordInfNameTypes' r = return r
|
||||
|
||||
markReplicators :: Data t => t -> PassM t
|
||||
markReplicators = checkDepthM mark
|
||||
where
|
||||
mark :: Check A.Replicator
|
||||
mark (A.ForEach _m n e)
|
||||
= astTypeOf n >>= \t -> markUnify (A.List t) e
|
||||
|
||||
-- | Folds all constants.
|
||||
constantFoldPass :: Data t => t -> PassM t
|
||||
constantFoldPass = applyDepthM doExpression
|
||||
|
|
Loading…
Reference in New Issue
Block a user