[GHC] #11460: OverloadedStrings cause error in annotation

GHC ghc-devs at haskell.org
Tue Jan 19 12:25:32 UTC 2016


#11460: OverloadedStrings cause error in annotation
-------------------------------------+-------------------------------------
        Reporter:  alanz             |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.3
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by alanz):

 In the parser, we have

 {{{
 aexp2   :: { LHsExpr RdrName }
         : qvar                          { sL1 $1 (HsVar   $! $1) }
         | qcon                          { sL1 $1 (HsVar   $! $1) }
         | ipvar                         { sL1 $1 (HsIPVar $! unLoc $1) }
         | overloaded_label              { sL1 $1 (HsOverLabel $! unLoc $1)
 }
         | literal                       { sL1 $1 (HsLit   $! unLoc $1) }
 -- This will enable overloaded strings permanently.  Normally the renamer
 turns HsString
 -- into HsOverLit when -foverloaded-strings is on.
 --      | STRING    { sL (getLoc $1) (HsOverLit $! mkHsIsString
 (getSTRINGs $1)
 --                                       (getSTRING $1) placeHolderType) }
 }}}

 The annotation expression in this case is parsed as a `HsString`, and the
 comment seems to indicate that the renamer should be making the `HsString`
 into an `HsOverLit` when `OverloadedStrings` is active, which I suspect is
 not happening.

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


More information about the ghc-tickets mailing list