cvs commit: fptools/ghc/compiler/typecheck TcBinds.lhs

Simon Peyton Jones simonpj@glass.cse.ogi.edu
Mon, 3 Dec 2001 03:36:26 -0800


simonpj     2001/12/03 03:36:26 PST

  Modified files:
    ghc/compiler/typecheck TcBinds.lhs 
  Log:
  	------------------------------------
  	Fix a tiresome and longstanding bug
  	in typechecking of unlifted bindings
  	------------------------------------
  
  Consider
  
  	data T = MkT Int# Int#
  
  	f :: T -> Int#
  	f t = a +# b
  	    where
  	      MkT a b = if ... then t else t
  
  This should really be OK, but if the "..." includes
  some constraints, the constraint simplifier was trying to
  generate some d1=d2 bindings. This is Bad because the desugarer
  treats unlifted bindings very specially (they are strict).
  
  This commit fixes the problem, by ensuring we never get
  local dictionary binding for an unlifted group.
  
  This fixes the bug which has been making the Alpha port fall
  over with a pattern-match failure in DsExpr.  Nothing to do
  with Alpha; it's just that the word-size change gave rise
  to a little more commoning-up of literals in the type checker
  which in turn made the desugarer it fall over.
  
  Revision  Changes    Path
  1.100     +34 -34    fptools/ghc/compiler/typecheck/TcBinds.lhs