[GHC] #13461: Panic on compile of file with a hole, importing a module with a lot of identifiers

GHC ghc-devs at haskell.org
Mon Mar 20 17:04:06 UTC 2017


#13461: Panic on compile of file with a hole, importing a module with a lot of
identifiers
-------------------------------------+-------------------------------------
           Reporter:  Tritlo         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.2
  (Type checker)                     |
           Keywords:                 |  Operating System:  MacOS X
       Architecture:  x86_64         |   Type of failure:  None/Unknown
  (amd64)                            |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 So I was trying to test the performance of `validSubstitutions`, I
 generated a file with a lot of identifiers, and compiled it with my
 current GHC, `The Glorious Glasgow Haskell Compilation System, version
 8.0.2`.

 The example was very simple, just:

 {{{
 import ManyIds

 test :: Int -> Int
 test = _
 }}}

 Where `ManyIds.hs` was generated with the python script:
 {{{
 print("module ManyIds where")
 print()

 for i in range(10000):
     print("a{} :: Int -> Int".format(i))
     print("a{} _ = {}".format(i,i))
     print()
 }}}

 i.e. it has a lot of identifiers of the form

 {{{
 ...
 a1337 :: Int -> Int
 a1337 _ = 1337

 a1338 :: Int -> Int
 a1338 _ = 1338
 ...
 }}}

 The error I  got was:

 {{{
 [2 of 2] Compiling Main             ( manyIdsTest.hs, manyIdsTest.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.2 for x86_64-apple-darwin):
         initTc: unsolved constraints
   WC {wc_insol = [W] __a5IO :: t_a5IN[tau:1] (CHoleCan: _)}

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

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


More information about the ghc-tickets mailing list