Opened 8 years ago

Closed 8 years ago

#5130 closed bug (fixed)

Panic on simple scoped type variable example

Reported by: john-nowak Owned by: simonpj
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 7.0.2
Keywords: ScopedTypeVariables panic Cc:
Operating System: MacOS X Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Test Case: ghci/scripts/T5130
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by simonpj)

When running GHCi with -XScopedTypeVariables:

Prelude> (\(x :: a, y :: a) -> [x, "hi"])
ghc: panic! (the 'impossible' happened)
  (GHC version 7.0.2 for i386-apple-darwin):
	nameModule $dShow{v akk}

I'm unsure if this has been fixed in 7.0.3; apologies if this is an old bug.

Change History (4)

comment:1 Changed 8 years ago by john-nowak

Here's a simpler example:

\(x :: a) -> [x, True]

comment:2 Changed 8 years ago by simonpj

Description: modified (diff)

No, it's a current bug. How embarrassing.

comment:3 Changed 8 years ago by simonpj

Owner: set to simonpj

comment:4 Changed 8 years ago by simonpj

Resolution: fixed
Status: newclosed
Test Case: ghci/scripts/T5130

Thanks for pointing this out. Fixed by

commit 2b6ba11cee81436aeed0ddab8ce5f53d51a349a9
Author: Simon Peyton Jones <>
Date:   Wed Apr 20 17:28:00 2011 +0100

    Fix Trac #5130: missed error report
    Some out of date code in TcErrors was suppressing an error
    report -- so some type-incorrect code leaked out and confused
    a later bit of the compiler.

 compiler/typecheck/TcErrors.lhs |   47 ++++++++++++++++++++-------------------
 1 files changed, 24 insertions(+), 23 deletions(-)
Note: See TracTickets for help on using tickets.