Opened 11 years ago

Closed 11 years ago

#734 closed bug (fixed)

Spurious type variable scope error report

Reported by: red5_2@… Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 6.4.1
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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
            foo1 :: Val v sm
            foo1 = bar

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

Change History (1)

comment:1 Changed 11 years ago by simonpj

Resolution: fixed
Status: newclosed

Fixed thank you.


Note: See TracTickets for help on using tickets.