Skip to content

Commit

Permalink
Use varToCoreExpr rather than Var (fixes #5315)
Browse files Browse the repository at this point in the history
A coercion variable in a term must be wrapped in a coercion!
(Led to lint errors.)
  • Loading branch information
Simon Peyton Jones committed Jul 15, 2011
1 parent f07af78 commit ce8c84a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/basicTypes/MkId.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler/stranal/WwLib.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ce8c84a

Please sign in to comment.