Skip to content

Eta-contraction gives a rather bogus type error message

Consider the following program:

module Main where

type T a = Show a => a

f :: T a -> String
f = show

Compiling this with GHC 6.10.3 and -fglasgow-exts gives:

[1 of 1] Compiling Main             ( Test.hs, interpreted )
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.3 for i386-apple-darwin):
	TcTyFuns.flattenType: unexpected PredType
Trac metadata
Trac field Value
Version 6.10.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC thomas@cs.ru.nl
Operating system MacOS X
Architecture x86
Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information