summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2008-06-14 02:38:09 +0000
committersimonpj@microsoft.com <unknown>2008-06-14 02:38:09 +0000
commit67fee0f2a808a26a7e2d906394ec287a0fba6461 (patch)
tree04f06b232881ada95f61bf6d9e7f7e6108c0b13f
parent0f5e104c36b1dc3d8deeec5fef3d65e7b3a1b5ad (diff)
downloadhaskell-67fee0f2a808a26a7e2d906394ec287a0fba6461.tar.gz
CoreLint should check for out-of-scope worker
-rw-r--r--compiler/coreSyn/CoreLint.lhs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/coreSyn/CoreLint.lhs b/compiler/coreSyn/CoreLint.lhs
index dda78c3544..8f5538c599 100644
--- a/compiler/coreSyn/CoreLint.lhs
+++ b/compiler/coreSyn/CoreLint.lhs
@@ -28,6 +28,7 @@ import VarEnv
import VarSet
import Name
import Id
+import IdInfo
import PprCore
import ErrUtils
import SrcLoc
@@ -227,7 +228,10 @@ lintSingleBinding top_lvl_flag rec_flag (binder,rhs)
where
binder_ty = idType binder
maybeDmdTy = idNewStrictness_maybe binder
- bndr_vars = varSetElems (idFreeVars binder)
+ bndr_vars = varSetElems (idFreeVars binder `unionVarSet` wkr_vars)
+ wkr_vars | workerExists wkr_info = unitVarSet (workerId wkr_info)
+ | otherwise = emptyVarSet
+ wkr_info = idWorkerInfo binder
lintBinder var | isId var = lintIdBndr var $ \_ -> (return ())
| otherwise = return ()
\end{code}