Opened 16 months ago

Closed 16 months ago

Last modified 15 months ago

#15202 closed bug (duplicate)

Internal error showing typed hole in GHCi

Reported by: dfeuer Owned by:
Priority: normal Milestone: 8.6.1
Component: Compiler (Type checker) Version: 8.5
Keywords: TypedHoles Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash or panic Test Case:
Blocked By: Blocking:
Related Tickets: #15007 Differential Rev(s):
Wiki Page:


Run ghc --interactive, and at the prompt type

default ()
fish :: Eq a => a; fish = undefined
foo :: String; foo = show _

The following error appears:

<interactive>:1:1: error:
    GHC internal error: ‘Ghci1.$trModule’ is not in scope during type checking, but it passed the renamer
    tcl_env of environment: [r2CZ :-> Identifier[foo::String, TopLevelLet]]

I have not yet been able to reproduce this loading a module; it seems to need to be on the command line.

Change History (4)

comment:1 Changed 16 months ago by dfeuer

This did not occur in 8.4.1.

comment:2 Changed 16 months ago by RyanGlScott

Resolution: duplicate
Status: newclosed

I believe this is a duplicate of #15007, so I'll close this in favor of that ticket.

comment:3 Changed 15 months ago by Ömer Sinan Ağacan <omeragacan@…>

In 39de4e3d/ghc:

Fix errors caused by invalid candidates leaking from hole fits

This is a one line fix (and a note) that fixes four tickets, #15007,
 #15321 and #15202, #15314

The issue was that errors caused by illegal candidates (according to GHC
stage or being internal names) were leaking to the user, causing
bewildering error messages. If a candidate causes the type checker to
error, it is not a valid hole fit, and should be discarded.

As mentioned in #15321, this can cause a pattern of omissions, which
might be hard to discover. A better approach would be to gather the
error messages, and ask users to report them as GHC bugs. This will be
implemented in a subsequent change.

Reviewers: bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #15007, #15321, #15202, #15314

Differential Revision:

comment:4 Changed 15 months ago by simonpj

Thanks -- can we add a regression test?

Note: See TracTickets for help on using tickets.