[GHC] #4042: Order of declarations affects the correctness of reported error.

GHC cvs-ghc at haskell.org
Tue May 4 05:49:47 EDT 2010


#4042: Order of  declarations affects the correctness of reported error.
---------------------------------+------------------------------------------
    Reporter:  ChrisN            |       Owner:                                   
        Type:  bug               |      Status:  new                              
    Priority:  normal            |   Component:  Compiler (Parser)                
     Version:  6.12.2            |    Keywords:                                   
          Os:  Linux             |    Testcase:                                   
Architecture:  Unknown/Multiple  |     Failure:  Incorrect warning at compile-time
---------------------------------+------------------------------------------
 In the following code
 {{{
 f :: A -> A
 f

 data A = A
 }}}
 leads to an out of scope error for 'A', whereas

 {{{
 data A = A

 f :: A -> A
 f
 }}}

 correctly claims that 'f' lacks an accompanying binding, and

 {{{
 data A = A

 f :: A -> A
 f = id
 f

 }}}
 produces that error that `f'
       is used in a top-level splice or annotation,

       and must be imported, not defined locally.


 Finally,
 {{{
 g = f
 h
 f = id

 }}}
 Gives an out of scope error for 'f', not 'h'

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


More information about the Glasgow-haskell-bugs mailing list