[GHC] #11665: Recent master fails to build attoparsec-0.13.0.1 with core lint failure

GHC ghc-devs at haskell.org
Wed Mar 2 15:22:49 UTC 2016


#11665: Recent master fails to build attoparsec-0.13.0.1 with core lint failure
------------------------------------+--------------------------------------
        Reporter:  anton.dessiatov  |                Owner:
            Type:  bug              |               Status:  new
        Priority:  normal           |            Milestone:
       Component:  Compiler         |              Version:  8.1
      Resolution:                   |             Keywords:
Operating System:  Linux            |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown     |            Test Case:
      Blocked By:                   |             Blocking:
 Related Tickets:  11664            |  Differential Rev(s):
       Wiki Page:                   |
------------------------------------+--------------------------------------

Comment (by Simon Peyton Jones <simonpj@…>):

 In [changeset:"286dc021ef515d02453cd5e31774b852d3a1310f/ghc"
 286dc021/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="286dc021ef515d02453cd5e31774b852d3a1310f"
 Fix an outright bug in expandTypeSynonyms

 The bug was in this code:

     go subst (TyConApp tc tys)
       | Just (tenv, rhs, tys') <- expandSynTyCon_maybe tc tys
       = let subst' = unionTCvSubst subst (mkTvSubstPrs tenv) in
         go subst' (mkAppTys rhs tys')

 This is wrong in two ways.
  * It is wrong to apply the expanded substitution to tys',
  * The unionTCvSubst is utterly wrong; after all, rhs is
    completely separate, and the union makes a non-idempotent
    substitution.

 It was the non-idempotency that gave the Lint failure in Trac #11665,
 when there was a type synonym whose RHS mentioned another type synonym,
 something like

   type T a b = a -> b
   type S x y = T y x

 It only affects SpecConstr because that's about the only place where
 expandTypeSyonym is called.  I tried to trigger the failure with a
 simple test case, but failed, so I have not added a regression test.

 Fortunately the solution is very simple and solid.

 FWIW, the culprit was 674654, "Add kind equalities to GHC".
 }}}

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


More information about the ghc-tickets mailing list