[GHC] #9426: ghci triggers 'ASSERT failed! file compiler/ghci/Linker.lhs, line 906'

GHC ghc-devs at haskell.org
Mon Aug 11 13:08:36 UTC 2014


#9426: ghci triggers 'ASSERT failed! file compiler/ghci/Linker.lhs, line 906'
-------------------------------------+-------------------------------------
              Reporter:  slyfox      |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.2
            Resolution:              |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by slyfox):

 Suspicious observation:

 As in original test case

 {{{!#hs
 instance {-# OVERLAPS #-} (HTrue ~ b)  => TypeEq x x b
 instance {-# OVERLAPS #-} (HTrue ~ b)  => TypeEq x x b
 instance {-# OVERLAPS #-} (HFalse ~ b) => TypeEq x y b
 }}}

 leads to error

 {{{
 *** Exception: ASSERT failed! file compiler/ghci/Linker.lhs, line 912
 }}}
 (the name failing invariant is '$fTypeEqxxb')

 If we slightly change free variables:

 {{{!#hs
 instance {-# OVERLAPS #-} (HTrue ~ b)  => TypeEq x x b
 instance {-# OVERLAPS #-} (HTrue ~ b)  => TypeEq y y b -- changed 'x' to
 'y'
 instance {-# OVERLAPS #-} (HFalse ~ b) => TypeEq x y b
 }}}

 there is no assert anymore:
 {{{
 Prelude> :script z.script
 WARNING: file compiler/simplCore/SimplEnv.lhs, line 539 $fTypeEqyyb
 WARNING: file compiler/simplCore/SimplEnv.lhs, line 539 $fTypeEqxyb
 WARNING: file compiler/simplCore/SimplEnv.lhs, line 539 $fTypeEqyyb
 WARNING: file compiler/simplCore/SimplEnv.lhs, line 539 $fTypeEqxyb
 }}}

 Looks like some generated names are not unique emough.

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


More information about the ghc-tickets mailing list