[GHC] #6120: GHC 7.4 improperly parses DEPRECATED pragma as ambiguous (regression)

GHC cvs-ghc at haskell.org
Wed May 23 05:37:18 CEST 2012


#6120: GHC 7.4 improperly parses DEPRECATED pragma as ambiguous (regression)
---------------------------------------+------------------------------------
 Reporter:  jmillikin                  |          Owner:                  
     Type:  bug                        |         Status:  new             
 Priority:  normal                     |      Component:  Compiler        
  Version:  7.4.1                      |       Keywords:                  
       Os:  Unknown/Multiple           |   Architecture:  Unknown/Multiple
  Failure:  GHC rejects valid program  |       Testcase:                  
Blockedby:                             |       Blocking:                  
  Related:                             |  
---------------------------------------+------------------------------------
 According to
 http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/pragmas.html
 #warning-deprecated-pragma , a DEPRECATED pragma's name only refers to
 top-level symbols in the module being compiled. It appears that GHC 7.4 ,
 this is no longer working correctly.

 The following module works in GHC 6.10 through 7.2, but fails in 7.4.

 {{{
 module Main where

 {-# DEPRECATED fail "fail is deprecated" #-}
 fail :: String -> String
 fail = id
 }}}

 {{{
 $ /opt/ghc_7.2.2/bin/ghci deprecated.hs
 GHCi, version 7.2.2: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Loading package ffi-1.0 ... linking ... done.
 [1 of 1] Compiling Main             ( deprecated.hs, interpreted )
 Ok, modules loaded: Main.
 *Main>
 }}}

 {{{
 $ /opt/ghc_7.4.1/bin/ghci deprecated.hs
 GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 [1 of 1] Compiling Main             ( deprecated.hs, interpreted )

 deprecated.hs:3:16:
     Ambiguous occurrence `fail'
     It could refer to either `Main.fail', defined at deprecated.hs:5:1
                           or `Prelude.fail',
                              imported from `Prelude' at
 deprecated.hs:1:8-11
                              (and originally defined in `GHC.Base')
 Failed, modules loaded: none.
 Prelude>
 }}}

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



More information about the Glasgow-haskell-bugs mailing list