[GHC] #13264: GHC panic with (->) generalization branch while compiling lens

GHC ghc-devs at haskell.org
Fri Feb 10 21:18:50 UTC 2017


#13264: GHC panic with (->) generalization branch while compiling lens
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * cc: simonpj, goldfire (added)


Comment:

 It appears that replacing the `tcRepSplitTyApp_maybe` callsite in
 `can_eq_nc'` with a variant which returns `Nothing` instead of panicking
 allows compilation to proceed,
 {{{#!hs
 -- Try to decompose type constructor applications
 -- Including FunTy (s -> t)
 can_eq_nc' _flat _rdr_env _envs ev eq_rel ty1 _ ty2 _
   | Just (tc1, tys1) <- tcRepSplitTyConApp_maybe' ty1
   , Just (tc2, tys2) <- tcRepSplitTyConApp_maybe' ty2
   , not (isTypeFamilyTyCon tc1)
   , not (isTypeFamilyTyCon tc2)
   = canTyConApp ev eq_rel tc1 tys1 tc2 tys2
 }}}
 Where `tcRepSplitTyConApp_maybe'` is the variant described above.

 While I'm far from convinced that this is the right, it does seem
 plausible. Afterall, the failing invocation involves a `FunTy` and an
 `AppTy`, so the guards really should just fail. It would be nice to hear
 Simon or Richard's opinion on this.

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


More information about the ghc-tickets mailing list