Fixed a couple of problems with the usage checking
This commit is contained in:
parent
68f808583b
commit
bcd670bfd2
|
@ -314,8 +314,13 @@ checkPlainVarUsage sharedAttr (m, p) = check p
|
|||
splitEnds :: (Var, a) -> m [(Var, a)]
|
||||
splitEnds (Var v, x)
|
||||
= do t <- astTypeOf v
|
||||
case t of
|
||||
A.Chan {} -> return
|
||||
case (t, v) of
|
||||
-- Push the direction up to the array, not outside:
|
||||
(A.Chan {}, A.SubscriptedVariable m sub v')
|
||||
-> return [(Var $ A.SubscriptedVariable m sub $
|
||||
A.DirectedVariable m dir v', x)
|
||||
| dir <- [A.DirInput, A.DirOutput]]
|
||||
(A.Chan {}, _) -> return
|
||||
[(Var $ A.DirectedVariable (findMeta v) dir v, x)
|
||||
| dir <- [A.DirInput, A.DirOutput]]
|
||||
_ -> return [(Var v, x)]
|
||||
|
|
|
@ -204,7 +204,7 @@ abbrevCheckPass
|
|||
return s
|
||||
doStructured s@(A.Spec _ (A.Specification m n (A.IsExpr _ A.ValAbbrev _ e)) scope)
|
||||
= do checkNotWritten (A.Variable m n) scope "VAL-abbreviated variable % written-to inside the scope of the abbreviation"
|
||||
sequence_ [checkAbbreved v scope
|
||||
sequence_ [checkNotWritten v scope
|
||||
"Abbreviated variable % used inside the scope of the abbreviation"
|
||||
| A.ExprVariable _ v <- listify (const True) e]
|
||||
return s
|
||||
|
|
Loading…
Reference in New Issue
Block a user