summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2011-07-15 11:49:38 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2011-07-15 11:49:38 +0100
commitce8c84a76d0a19ff56d4c4e58744776fda2044bd (patch)
tree564f57aa0f34acd14d25408eee11832ec87653ee
parentf07af788f1d8009034332a5c0b659486fa9b4d26 (diff)
downloadhaskell-ce8c84a76d0a19ff56d4c4e58744776fda2044bd.tar.gz
Use varToCoreExpr rather than Var (fixes #5315)
A coercion variable in a term must be wrapped in a coercion! (Led to lint errors.)
-rw-r--r--compiler/basicTypes/MkId.lhs2
-rw-r--r--compiler/stranal/WwLib.lhs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/basicTypes/MkId.lhs b/compiler/basicTypes/MkId.lhs
index bf58c5ac19..7993b05deb 100644
--- a/compiler/basicTypes/MkId.lhs
+++ b/compiler/basicTypes/MkId.lhs
@@ -584,7 +584,7 @@ mkProductBox arg_ids ty
result_expr
| isNewTyCon tycon && not (isRecursiveTyCon tycon)
= wrap (mkProductBox arg_ids (newTyConInstRhs tycon tycon_args))
- | otherwise = mkConApp pack_con (map Type tycon_args ++ map Var arg_ids)
+ | otherwise = mkConApp pack_con (map Type tycon_args ++ varsToCoreExprs arg_ids)
wrap expr = wrapNewTypeBody tycon tycon_args expr
diff --git a/compiler/stranal/WwLib.lhs b/compiler/stranal/WwLib.lhs
index 391c07c089..1b8b270024 100644
--- a/compiler/stranal/WwLib.lhs
+++ b/compiler/stranal/WwLib.lhs
@@ -449,7 +449,7 @@ mkWWcpr body_ty RetCPR
uniqs <- getUniquesM
let
(wrap_wild : work_wild : args) = zipWith mk_ww_local uniqs (ubx_tup_ty : body_ty : con_arg_tys)
- arg_vars = map Var args
+ arg_vars = varsToCoreExprs args
ubx_tup_con = tupleCon Unboxed n_con_args
ubx_tup_ty = exprType ubx_tup_app
ubx_tup_app = mkConApp ubx_tup_con (map Type con_arg_tys ++ arg_vars)