Incorrect function signature causes the impossible to happen
I made a mistake in my function signature:
> cat wibble.hs
ecase :: Either a b -> (a -> c) (b -> c) -> c
ecase (Left a) f _ = f a
ecase (Right b) _ g = g b
> ghci wibble.hs
GHCi, version 8.2.0.20170507: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/erikd/.ghci
[1 of 1] Compiling Main ( wibble.hs, interpreted )
ghc: panic! (the 'impossible' happened)
(GHC version 8.2.0.20170507 for x86_64-unknown-linux): repSplitAppTys
a_a1pA[sk:1]
c_a1pC[sk:1]
[]
Call stack:
CallStack (from HasCallStack):
prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1134:58 in
ghc:Outputable
callStackDoc, called at compiler/utils/Outputable.hs:1138:37 in
ghc:Outputable
pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type
GHC 8.02 correctly reports an error:
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/erikd/.ghci
[1 of 1] Compiling Main ( wibble.hs, interpreted )
wibble.hs:1:24: error:
• Expecting one fewer argument to ‘a -> c’
Expected kind ‘* -> *’, but ‘a -> c’ has kind ‘*’
• In the type signature:
ecase :: Either a b -> (a -> c) (b -> c) -> c
Trac metadata
Trac field | Value |
---|---|
Version | 8.2.1-rc2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |