From: simonpj Date: Thu, 3 Jul 2003 10:35:37 +0000 (+0000) Subject: [project @ 2003-07-03 10:35:37 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~709 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c7b2a8e7b280a95bf6cb11131108c786a1feb8ea;p=ghc-hetmet.git [project @ 2003-07-03 10:35:37 by simonpj] Dont report assert as unused; merge to stable --- diff --git a/ghc/compiler/rename/RnExpr.lhs b/ghc/compiler/rename/RnExpr.lhs index e926ef0..a00cfae 100644 --- a/ghc/compiler/rename/RnExpr.lhs +++ b/ghc/compiler/rename/RnExpr.lhs @@ -162,7 +162,9 @@ rnExpr (HsVar v) = lookupOccRn v `thenM` \ name -> if name `hasKey` assertIdKey && not opt_IgnoreAsserts then -- We expand it to (GHC.Err.assertError location_string) - mkAssertErrorExpr + mkAssertErrorExpr `thenM` \ (e, fvs) -> + returnM (e, fvs `addOneFV` name) + -- Keep 'assert' as a free var, to ensure it's not reported as unused! else -- The normal case. Even if the Id was 'assert', if we are -- ignoring assertions we leave it as GHC.Base.assert;