[GHC] #14471: Certain do blocks cause TH to barf when ApplicativeDo is enabled

GHC ghc-devs at haskell.org
Thu Nov 16 01:34:44 UTC 2017


#14471: Certain do blocks cause TH to barf when ApplicativeDo is enabled
-------------------------------------+-------------------------------------
           Reporter:  lexi.lambda    |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Template       |           Version:  8.2.1
  Haskell                            |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Compile-time
  Unknown/Multiple                   |  crash or panic
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The following program fails with an error:

 {{{#!hs
 {-# LANGUAGE ApplicativeDo #-}
 {-# LANGUAGE TemplateHaskell #-}

 main = $([|do
   return ()
   return ()
   return ()|])
 }}}
 {{{
 Exotic.hs:4:12: error:
     Exotic statement not (yet) handled by Template Haskell
       [return ();
        return (),
        return ()]
 }}}

 It only happens when `ApplicativeDo` is enabled.

 Furthermore, while this example is extremely minimal, this issue isn’t
 restricted to `ApplicativeDo`’s special handling of `return`. The
 following example produces the same error:

 {{{#!hs
 {-# LANGUAGE ApplicativeDo #-}
 {-# LANGUAGE TemplateHaskell #-}

 main = $([|do
   getLine
   getLine
   getLine|])
 }}}
 {{{
 Exotic.hs:4:12: error:
     Exotic statement not (yet) handled by Template Haskell
       [getLine;
        getLine,
        getLine]
 }}}

 This ''doesn’t'' happen with fewer than three statements in the `do`
 block, but it ''does'' happen with more.

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


More information about the ghc-tickets mailing list