summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonm <unknown>1999-01-22 10:25:44 +0000
committersimonm <unknown>1999-01-22 10:25:44 +0000
commitcc3cf678f28c34364cad993b15615acc0686b0d5 (patch)
treeaff8b06fd319a2b4f781ff7b6c7bfbfe1bb7603d
parente5efd651e7e80cd3549304578a1e1685e91d3d0a (diff)
downloadhaskell-cc3cf678f28c34364cad993b15615acc0686b0d5.tar.gz
[project @ 1999-01-22 10:25:44 by simonm]
Fix a use of [ e1..e2 ] in the light of the new Haskell 98 semantics.
-rw-r--r--ghc/compiler/typecheck/TcExpr.lhs8
1 files changed, 6 insertions, 2 deletions
diff --git a/ghc/compiler/typecheck/TcExpr.lhs b/ghc/compiler/typecheck/TcExpr.lhs
index aae7a24896..6c32a246d3 100644
--- a/ghc/compiler/typecheck/TcExpr.lhs
+++ b/ghc/compiler/typecheck/TcExpr.lhs
@@ -347,8 +347,12 @@ tcMonoExpr (CCall lbl args may_gc is_asm ignored_fake_result_ty) res_ty
in
-- Arguments
- mapNF_Tc (\ _ -> newTyVarTy_OpenKind) [1..(length args)] `thenNF_Tc` \ arg_tys ->
- tcMonoExprs args arg_tys `thenTc` \ (args', args_lie) ->
+ let n_args = length args
+ tv_idxs | n_args == 0 = []
+ | otherwise = [1..n_args]
+ in
+ mapNF_Tc (\ _ -> newTyVarTy_OpenKind) tv_idxs `thenNF_Tc` \ arg_tys ->
+ tcMonoExprs args arg_tys `thenTc` \ (args', args_lie) ->
-- The argument types can be unboxed or boxed; the result
-- type must, however, be boxed since it's an argument to the IO