Skip to content

Internal error on invalid record update

A silly function:

foo :: () -> ()
foo x = x { foo = 1 }
  1. 8.2 says:
GHC internal error: `foo' is not in scope
In the expression: x {foo = 1}
In the definition of `foo': foo x = x {foo = 1}

HEAD's message is a bit more illuminating:

GHC internal error: `foo' is not in scope during type checking, but it passed the renamer
tcg_type_env of environment: []
In the expression: x {foo = 1}
In the definition of `foo': foo x = x {foo = 1}
Trac metadata
Trac field Value
Version 6.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information