[GHC] #13474: GHC HEAD regression: Prelude.!!: index too large

GHC ghc-devs at haskell.org
Fri Mar 24 09:14:16 UTC 2017


#13474: GHC HEAD regression: Prelude.!!: index too large
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I'm pretty sure Phab:D3316 will fix.  I thought it was merged already.

 As a side comment, Richard, we were discussing yesterday why we meed
 `match_co` in rule matching.  Here we do!  See #13476!

 Also: '''Ben''', once you have merged Phab:D3316, and checked that it
 works, can you also swap the order of these two equations in
 `Rules.match_co`?
 {{{
 match_co renv subst co1 co2
   | Just (tc1, cos1) <- splitTyConAppCo_maybe co1
   = case splitTyConAppCo_maybe co2 of
       Just (tc2, cos2)
         |  tc1 == tc2
         -> match_cos renv subst cos1 cos2
       _ -> Nothing
 match_co renv subst co1 co2
   | Just (arg1, res1) <- splitFunCo_maybe co1
   = case splitFunCo_maybe co2 of
       Just (arg2, res2)
         -> match_cos renv subst [arg1, res1] [arg2, res2]
       _ -> Nothing
 }}}
 Currently the second will never match because `splitTyConAppCo_maybe`
 succeeds (inefficiently) on `FunCo`.  Swapping them will make it more
 efficient.

 Swapping them will probably conceal the bug, so test the fix first!

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


More information about the ghc-tickets mailing list