Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2141 closed merge (fixed)

Internal error on invalid record update

Reported by: rl Owned by: igloo
Priority: normal Milestone: 6.10 branch
Component: Compiler (Type checker) Version: 6.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: rnfail054
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

A silly function:

foo :: () -> ()
foo x = x { foo = 1 }

6.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}

Change History (6)

comment:1 Changed 10 years ago by igloo

Component: CompilerCompiler (Type checker)
difficulty: Unknown
Milestone: 6.10 branch

Thanks for the report; the error could certainly be better!

comment:2 Changed 10 years ago by simonpj

Owner: set to simonpj

I'm fixing this.

comment:3 Changed 10 years ago by simonpj

Owner: changed from simonpj to igloo
Type: bugmerge

Fixed by

Wed Apr  2 06:20:57 PDT 2008  simonpj@microsoft.com
  * Fix Trac #2141: invalid record update

Ian: can you add a test case as well as merging?

Simon

comment:4 Changed 9 years ago by igloo

Resolution: fixed
Status: newclosed
Test Case: rnfail054

Merged, and rnfail054 added.

comment:5 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:6 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.