Spurious type variable scope error report
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
.
Trac metadata
Trac field | Value |
---|---|
Version | 6.4.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |