[GHC] #15270: TH doesn't verify name types during conversion

GHC ghc-devs at haskell.org
Wed Jun 13 16:04:47 UTC 2018


#15270: TH doesn't verify name types during conversion
-------------------------------------+-------------------------------------
           Reporter:  bgamari        |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Template       |           Version:  8.4.3
  Haskell                            |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Angerman reported that a use of the [[http://hackage.haskell.org/package
 /deriving-compat-0.4.2/docs/src/Data.Eq.Deriving.Internal.html#deriveEq1
 `deriveEq`]] splice is causing GHC to abort with an assertion failure:
 {{{#!hs
 zonkExpr env (HsVar x (L l id))
   = ASSERT2( isNothing (isDataConId_maybe id), ppr id )
     return (HsVar x (L l (zonkIdOcc env id)))
 }}}

 I suspect the `deriveEq1` is calling `varE` with a DataCon name. We should
 catch this case and throw a better error message.

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


More information about the ghc-tickets mailing list