[GHC] #1176: Infinite loop when printing error message

GHC trac at galois.com
Thu Jun 26 14:45:52 EDT 2008


#1176: Infinite loop when printing error message
---------------------------------------+------------------------------------
 Reporter:  Paul_Berry at alumni.hmc.edu  |          Owner:  thorkilnaur
     Type:  bug                        |         Status:  new        
 Priority:  low                        |      Milestone:  _|_        
Component:  Compiler                   |        Version:  6.6        
 Severity:  normal                     |     Resolution:             
 Keywords:                             |     Difficulty:  Unknown    
 Testcase:  tcfail177                  |   Architecture:  Multiple   
       Os:  Multiple                   |  
---------------------------------------+------------------------------------
Comment (by thorkilnaur):

 With
 {{{
 $ ghc --version
 The Glorious Glasgow Haskell Compilation System, version 6.8.2
 }}}
 and the following variant of the Simon PJ test case
 {{{
 $ cat 1176PJ.hs
 module Foo5 where

 -- The more infix ops we have, the worse fsep works

 allTest1 :: Bool
 allTest1 = foo
            ["One........" ~?= "1"
            ,"Two" ~?= "2"
            ,"Thre........." ~?= "3"
            ,"Four" ~?= "4"
            ,"Five" ~?= "5"
            ]

 allTest2 :: Bool
 allTest2 = foo
            ["One........" ~?= "1"
            ,"Two.................." ~?= "2"
            ,"Thre........." ~?= "3"
            ,"Four" ~?= "4"
            ,"Five" ~?= "5"
            ]

 a=""
 b=""

 (~?=) :: a -> a -> Bool
 (~?=) = error "urk"

 foo :: a -> Int
 foo x = 0
 }}}
 I get
 {{{
 $ ghc --make 1176PJ.hs
 [1 of 1] Compiling Foo5             ( 1176PJ.hs, 1176PJ.o )

 1176PJ.hs:6:11:
     Couldn't match expected type `Bool' against inferred type `Int'
     In the expression:
         foo
           ["One........" ~?= "1", "Two" ~?= "2", "Thre........." ~?= "3",
        "Four" ~?= "4", ....]
     In the definition of `allTest1':
         allTest1 = foo
                      ["One........" ~?= "1", "Two" ~?= "2",
 "Thre........." ~?= "3",
                 ....]

 1176PJ.hs:15:11:
     Couldn't match expected type `Bool' against inferred type `Int'
     In the expression:
         foo
           ["One........" ~?= "1", "Two.................." ~?= "2",
          "Thre........." ~?= "3", "Four" ~?= "4", ....]
     In the definition of `allTest2':
         allTest2 = foo
                      ["One........" ~?= "1", "Two.................." ~?=
 "2",
                     "Thre........." ~?= "3", ....]
 $
 }}}
 The inconsistent indent of the second lines of the first list contained in
 these messages indicates that an error is, indeed, still present in the
 internal GHC version of the library.

 Best regards
 Thorkil

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


More information about the Glasgow-haskell-bugs mailing list