Ticket #2141 (closed merge: fixed)

Opened 5 years ago

Last modified 5 years ago

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: Difficulty: Unknown
Test Case: rnfail054 Blocked By:
Blocking: Related Tickets:

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

Changed 5 years ago by igloo

  • difficulty set to Unknown
  • component changed from Compiler to Compiler (Type checker)
  • milestone set to 6.10 branch

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

Changed 5 years ago by simonpj

  • owner set to simonpj

I'm fixing this.

Changed 5 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  simonpj@microsoft.com
  * Fix Trac #2141: invalid record update

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

Simon

Changed 5 years ago by igloo

  • status changed from new to closed
  • testcase set to rnfail054
  • resolution set to fixed

Merged, and rnfail054 added.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

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