[project @ 2004-10-04 15:51:00 by simonpj]
authorsimonpj <unknown>
Mon, 4 Oct 2004 15:51:04 +0000 (15:51 +0000)
committersimonpj <unknown>
Mon, 4 Oct 2004 15:51:04 +0000 (15:51 +0000)
commitf469905af60366ec85f08c0e9f83a34624d3a160
treec305ac34750cad88d336ed0f9916205683e60691
parent3b7d2756979023bd5244ea2a448237e091405db6
[project @ 2004-10-04 15:51:00 by simonpj]
------------------------------------
Part-fix an awkward interaction
between case-of-case and GADTs
------------------------------------

Consider
data T a where
  MkT :: a -> b -> T a

f = /\a. \(w::a).
   case (case ...) of
  MkT a' b (p::a') (q::b) -> [p,w]

The danger is that we'll make a join point

j a' p = [p,w]

and that's ill-typed, because (p::a') but (w::a).

Solution so far: don't abstract over a', because the type refinement
maps [a' -> a] .  Ultimately that won't work when real refinement goes on.

Then we must abstract over any refined free variables.  Hmm.  Maybe we
could just abstract over *all* free variables, thereby lambda-lifting
the join point?   We should try this.
ghc/compiler/basicTypes/DataCon.lhs
ghc/compiler/coreSyn/CoreLint.lhs
ghc/compiler/simplCore/Simplify.lhs