[GHC] #734: Spurious type variable scope error report

GHC trac at galois.com
Sat Mar 25 19:23:31 EST 2006


#734: Spurious type variable scope error report
----------------------------------------+-----------------------------------
    Reporter:  red5_2 at hotmail.com       |        Owner:         
        Type:  bug                      |       Status:  new    
    Priority:  normal                   |    Milestone:         
   Component:  Compiler (Type checker)  |      Version:  6.4.1  
    Severity:  normal                   |     Keywords:         
          Os:  Linux                    |   Difficulty:  Unknown
Architecture:  x86_64 (amd64)           |  
----------------------------------------+-----------------------------------
A spurious error message about a variable being out of scope can be
 triggered by a kind error.  The kind error and scope error need not occur
 in the same function.

 This code reproduces the error:

 {{{
 data Val v sm = Val
 foo :: forall v sm. Val v sm
 foo = undefined
     where foo1 :: Val v sm
    foo1 = bar
 -- Correct type signature: bar :: forall v sm. Val v sm
 bar :: forall v. Val v
 bar = undefined foo
 }}}

 The reported error looks like this:

 {{{
 GHC internal error: `v' is not in scope
 In the type signature: foo1 :: Val v sm
 In the definition of `foo':
     foo = undefined
         where
             foo1 :: Val v sm
             foo1 = bar
 }}}

 A kind error is also reported for the type signature of `bar`.

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


More information about the Glasgow-haskell-bugs mailing list