[GHC] #13388: Caret diagnostics interact badly with hsc2hs

GHC ghc-devs at haskell.org
Tue Mar 7 15:57:41 UTC 2017


#13388: Caret diagnostics interact badly with hsc2hs
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  error/warning at compile-time      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Here's an easier way to reproduce this:

 {{{#!hs
 module Bug where

 #define LONG_CONSTANT_NAME 42

 lONG_CONSTANT_NAME = #{const LONG_CONSTANT_NAME} :: Int32
 }}}

 {{{
 $ hsc2hs Bug.hsc
 $ ~/Software/ghc5/inplace/bin/ghc-stage2 --interactive -Wall Bug.hs
 GHCi, version 8.1.20170303: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )

 Bug.hsc:5:28: error:
     Not in scope: type constructor or class ‘Int32’
   |
 5 | lONG_CONSTANT_NAME = #{const LONG_CONSTANT_NAME} :: Int32
   |                            ^^^^^
 Failed, modules loaded: none.
 }}}

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


More information about the ghc-tickets mailing list