Fix egregious and long-standing tidying bug
authorsimonpj@microsoft.com <unknown>
Thu, 25 May 2006 09:43:00 +0000 (09:43 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 25 May 2006 09:43:00 +0000 (09:43 +0000)
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.

compiler/coreSyn/CoreTidy.lhs

index ba60466..6f13740 100644 (file)
@@ -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)