#5589: Duplicate type signature not reported
--------------------------------+-------------------------------------------
    Reporter:  MikolajKonarski  |       Owner:                             
        Type:  bug              |      Status:  patch                      
    Priority:  normal           |   Component:  Compiler                   
     Version:  7.3              |    Keywords:                             
    Testcase:                   |   Blockedby:                             
          Os:  Linux            |    Blocking:                             
Architecture:  x86_64 (amd64)   |     Failure:  GHC accepts invalid program
--------------------------------+-------------------------------------------
Changes (by michalt):

  * status:  new => patch


Comment:

 The problem is caused by changes for #1595. Originally checking for
 duplicates
 was performed by equality test (`eqHsSig`), but now a signature can have a
 list
 of names so testing for equality obviously isn't enough. The patch checks
 if the
 signatures overlap (i.e. there is at least one name that is in both
 signatures).
 And so for the original example we get:
 {{{
 T5589.hs:4:1:
     Duplicate type signature:
       T5589.hs:4:1-10: aaa :: Int
       T5589.hs:3:1-15: bbb, aaa :: Int
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to