GHC bug
A frog told me about this
(a ... b) xs
| a == x
, (l, _:r) <- break (== x) xs
= l ++ [x]
baldur@Loki:~$ ghci -fobject-code -fdefer-typed-holes -ignore-dot-ghci /tmp/tnVL.hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( /tmp/tnVL.hs, /tmp/tnVL.o )
/tmp/tnVL.hs:2:10: warning: [-Wtyped-holes]
Variable not in scope: x
/tmp/tnVL.hs:3:27: warning: [-Wtyped-holes]
Variable not in scope: x
/tmp/tnVL.hs:4:11: warning: [-Wtyped-holes]
Variable not in scope: x
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.1 for x86_64-unknown-linux):
StgCmmEnv: variable not found
$dEq_a26w
local binds for:
$trModule
$trModule1_r29y
$trModule2_r2a9
x_r2aa
x1_r2ab
x2_r2ac
a2_s2ah
b_s2ai
xs_s2aj
fail_s2ak
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
I managed to find a more minimal example
u a | a == x = undefined
doesn't trigger error in GHCi.
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |