From: simonpj@microsoft.com Date: Thu, 25 May 2006 09:43:00 +0000 (+0000) Subject: Fix egregious and long-standing tidying bug X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=a5168e30f331c6fe912cca4f53be8544ce6800d5 Fix egregious and long-standing tidying bug A typo in tidyAlt meant that we could get shadowing of occurrence names in the output of tidying. (Specifically, of existentially bound type variables.) That in turn meant that an IfaceExpr could have shadowing, so when the IfaceExpr was read in, it meant something different. That in turn led to an obscure crash like: Panic: tcIfaceTyVar Anyway, this fixes it. MERGE into 6.4.3. --- diff --git a/compiler/coreSyn/CoreTidy.lhs b/compiler/coreSyn/CoreTidy.lhs index ba60466..6f13740 100644 --- a/compiler/coreSyn/CoreTidy.lhs +++ b/compiler/coreSyn/CoreTidy.lhs @@ -81,7 +81,7 @@ tidyAlt case_bndr env (DataAlt con, vs, rhs) | not (isVanillaDataCon con) -- GADT case = tidyBndrs env tvs =: \ (env1, tvs') -> let - env2 = refineTidyEnv env con tvs' scrut_ty + env2 = refineTidyEnv env1 con tvs' scrut_ty in tidyBndrs env2 ids =: \ (env3, ids') -> (DataAlt con, tvs' ++ ids', tidyExpr env3 rhs)