[GHC] #3219: functions on records with overloaded names can be given a too-specific type

GHC trac at galois.com
Wed May 13 11:50:03 EDT 2009


#3219: functions on records with overloaded names can be given a too-specific type
-----------------------------------------------+----------------------------
    Reporter:  dmwit                           |        Owner:                  
        Type:  bug                             |       Status:  closed          
    Priority:  normal                          |    Milestone:                  
   Component:  Compiler (Type checker)         |      Version:  6.10.1          
    Severity:  normal                          |   Resolution:  fixed           
    Keywords:                                  |   Difficulty:  Unknown         
    Testcase:  typecheck/should_compile/T3219  |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple                |  
-----------------------------------------------+----------------------------
Changes (by simonpj):

  * testcase:  => typecheck/should_compile/T3219
  * status:  reopened => closed
  * resolution:  => fixed

Comment:

 Aha! I was looking only at `bar`, for which my claims are correct.  I
 ignored `foo`, and you are quite right: `foo`'s inferred type is utterly
 wrong. And indeed, compiling your code with `-dcore-lint` barfs in GHC
 6.10.

 Fixed by this patch, with a test case added to the regression suite:
 {{{
 Wed May 13 16:09:22 BST 2009  simonpj at microsoft.com
   * Fix Trac #3219: type of a record update

   Record updates are amazingly hard to typecheck right.  This is one place
   where GHC's policy of typechecking the original source is much harder
 than
   desugaring and typechecking that!

   Anyway, the bug here is that to compute the 'fixed' type variables I was
   only looking at one constructor rather than all the relevant_cons
 }}}
 Thank you for being persistent.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3219#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list