Fix Trac #3406 (albeit not very satisfactorily): scoped type variables
authorsimonpj@microsoft.com <unknown>
Tue, 25 Aug 2009 07:30:59 +0000 (07:30 +0000)
committersimonpj@microsoft.com <unknown>
Tue, 25 Aug 2009 07:30:59 +0000 (07:30 +0000)
commitf670c47f9f93ffd6d06b331cd40554cd5e92484c
tree909698f2ef5f2e04d7416297a10098ebb3d17475
parent738f70785e381ca2f43413a1d8efa4d5929b8231
Fix Trac #3406 (albeit not very satisfactorily): scoped type variables

The issue here is this:

  type ItemColID a b = Int  -- Discards a,b

  get :: ItemColID a b -> a -> ItemColID a b
  get (x :: ItemColID a b) = x :: ItemColID a b

The pattern signature for 'x' doesn't actually rigidly bind a,b.
This crashed GHC 6.10 with a 'readFilledBox' panic.  Now we fail
with an erroe message

With the new outside-in algorithm we'll be able to accept this program.
compiler/typecheck/TcHsType.lhs