Opened 7 years ago

Closed 7 years ago

Last modified 7 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: Test Case: rnfail054
Blocked By: Blocking:
Related Tickets: Differential Revisions:

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 7 years ago by igloo

  • Component changed from Compiler to Compiler (Type checker)
  • difficulty set to Unknown
  • Milestone set to 6.10 branch

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

comment:2 Changed 7 years ago by simonpj

  • Owner set to simonpj

I'm fixing this.

comment:3 Changed 7 years ago by simonpj

  • Owner changed from simonpj to igloo
  • Type changed from bug to merge

Fixed by

Wed Apr  2 06:20:57 PDT 2008  [email protected]
  * Fix Trac #2141: invalid record update

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

Simon

comment:4 Changed 7 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to rnfail054

Merged, and rnfail054 added.

comment:5 Changed 7 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:6 Changed 7 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.