[GHC] #8569: ASSERT in testcase type-rep, only in some ways:

GHC ghc-devs at haskell.org
Fri Nov 29 10:13:59 UTC 2013


#8569: ASSERT in testcase type-rep, only in some ways:
-------------------------------------+------------------------------------
        Reporter:  nomeata           |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Test Suite        |          Version:  7.7
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by nomeata):

 I believe the problem is a mis-calculated demand for `addUp`:

 {{{
 Rec {
 Example.addUp [Occ=LoopBreaker]
   :: forall a_aqp. Example.Rep a_aqp -> a_aqp -> GHC.Types.Int
 [LclIdX,
  Arity=2,
  Str=DmdType <S,1*U><L,U(U)>,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Arity=2, Value=True,
          ConLike=True, WorkFree=True, Expandable=True,
          Guidance=IF_ARGS [30 0] 70 0}]
 Example.addUp =
   \ (@ a_aBI)
     (ds_dBY [Dmd=<S,1*U>] :: Example.Rep a_aBI)
     (n_aqq [Dmd=<L,U(U)>] :: a_aBI) ->
     case ds_dBY of _ {
       Example.Rint dt_dC2 [Dmd=<L,A>] ->
         n_aqq `cast` (Sub dt_dC2 :: a_aBI ~# GHC.Types.Int);
       Example.Rdata @ i_aBR i_aqr [Dmd=<S,1*U>]
                     f_aqs [Dmd=<L,1*C1(U(U))>] g_aqt [Dmd=<L,A>] ->
         Example.addUp @ i_aBR i_aqr (f_aqs n_aqq)
     }
 end Rec }
 }}}

 The demand on its first argument, `U(U)`, clearly comes from the `Rint`
 case (where it is true), but in the other case this demand does not even
 type-check, as `a` can be some other type. So what goes wrong here?..

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


More information about the ghc-tickets mailing list