[GHC] #13642: GHCi 8.2 simply ignores TH splice using datatype with a forall'd kind signature

GHC ghc-devs at haskell.org
Thu May 4 16:27:22 UTC 2017


#13642: GHCi 8.2 simply ignores TH splice using datatype with a forall'd kind
signature
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.2.1-rc1
      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:                    |
-------------------------------------+-------------------------------------

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

 In [changeset:"e77019767fe5327011c6dc8fe089c64884120aab/ghc" e770197/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="e77019767fe5327011c6dc8fe089c64884120aab"
 Deal with exceptions in dsWhenNoErrs

 Gracious me.  Ever since this patch

   commit 374457809de343f409fbeea0a885877947a133a2
   Author: Jan Stolarek <jan.stolarek at p.lodz.pl>
   Date:   Fri Jul 11 13:54:45 2014 +0200

       Injective type families

 TcRnMonad.askNoErrs has been wrong. It looked like this

    askNoErrs :: TcRn a -> TcRn (a, Bool)
    askNoErrs m
     = do { errs_var <- newTcRef emptyMessages
          ; res  <- setErrsVar errs_var m
          ; (warns, errs) <- readTcRef errs_var
          ; addMessages (warns, errs)
          ; return (res, isEmptyBag errs) }

 The trouble comes if 'm' throws an exception in the TcRn monad.
 Then 'errs_var is never read, so any errors are simply lost.

 This mistake was then propgated into DsMonad.dsWhenNoErrs, where
 it gave rise to Trac #13642.

 Thank to Ryan for narrowing it down so sharply.

 I did some refactoring, as usual.
 }}}

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


More information about the ghc-tickets mailing list