GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:43:45Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/8729Compile crashed with panic! (the 'impossible' happened)2019-07-07T18:43:45ZzabiraufCompile crashed with panic! (the 'impossible' happened)The following code results in a compiler crash with error
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for x86_64-unknown-linux):
nameModule show{tv a9N}
Please report this as a GHC bug: http://www.haskell.org/ghc...The following code results in a compiler crash with error
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for x86_64-unknown-linux):
nameModule show{tv a9N}
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
The code can be found at [http://pastie.org/8692515](http://pastie.org/8692515)7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/7193darcs 2.8 fails to compile with ghc 7.62019-07-07T18:50:55Zpcapriottidarcs 2.8 fails to compile with ghc 7.6Ganesh Sittampalam reports the following failure when building darcs 2.8 with ghc 7.6 RC1:
```
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.6.0.20120822 for i386-unknown-mingw32):
ds_ev_term
cobox{v a6Aho} [l...Ganesh Sittampalam reports the following failure when building darcs 2.8 with ghc 7.6 RC1:
```
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.6.0.20120822 for i386-unknown-mingw32):
ds_ev_term
cobox{v a6Aho} [lid] `cast`
(<main:Darcs.Test.Patch.WithState.WithState{tc r1oms}
model{tv t4H} [tv]
(main:Darcs.Witnesses.Ordered.FL{tc
r1iNn} prim{tv t4D} [tv]
main:Darcs.Witnesses.Ordered.:>{tc
r1iNy} main:Darcs.Witnesses.Ordered.FL{tc r1iNn}
prim{tv t4D} [tv])>
ghc-prim:GHC.Types.~{(w) tc 31Q}
main:Darcs.Test.Patch.WithState.WithState{tc r1oms}
(Sym
cobox{v a6AgE} [lid])
<main:Darcs.Witnesses.Ordered.FL{tc r1iNn}
prim{tv t4D} [tv]
main:Darcs.Witnesses.Ordered.:>{tc r1iNy}
main:Darcs.Witnesses.Ordered.FL{tc r1iNn}
prim{tv t4D} [tv]>)
(let {EvBinds{cobox{v a6zY5} [lid]
= cobox{v a6Aho} [lid] `cast`
(<main:Darcs.Test.Patch.WithState.WithState{tc r1oms}
model{tv t4H} [tv]
(main:Darcs.Witnesses.Ordered.FL{tc r1iNn}
prim{tv t4D} [tv]
main:Darcs.Witnesses.Ordered.:>{tc r1iNy}
main:Darcs.Witnesses.Ordered.FL{tc r1iNn}
prim{tv t4D} [tv])>
ghc-prim:GHC.Types.~{(w) tc 31Q}
main:Darcs.Test.Patch.WithState.WithState{tc r1oms}
(Sym
cobox{v a6AgE} [lid])
<main:Darcs.Witnesses.Ordered.FL{tc r1iNn}
prim{tv t4D} [tv]
main:Darcs.Witnesses.Ordered.:>{tc r1iNy}
main:Darcs.Witnesses.Ordered.FL{tc r1iNn}
prim{tv t4D} [tv]>)
cobox{v a6zY6} [lid] = CO <t{tv a6zY1} [tv]>}}
cobox{v a6zY5} [lid] <xx{tv a6zY3} [sk]> <yy{tv a6zY4} [sk]>
-> <t{tv a6zY1} [tv]>)
```
Project + dependencies can be found at http://urchin.earth.li/\~ganesh/temp/tcproblem.tar.bz2 (run build.sh).
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.6.1-rc1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"darcs 2.8 fails to compile with ghc 7.6","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"7.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.6.1-rc1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Ganesh Sittampalam reports the following failure when building darcs 2.8 with ghc 7.6 RC1:\r\n\r\n{{{\r\nghc.exe: panic! (the 'impossible' happened)\r\n (GHC version 7.6.0.20120822 for i386-unknown-mingw32):\r\n ds_ev_term\r\n cobox{v a6Aho} [lid] `cast`\r\n(<main:Darcs.Test.Patch.WithState.WithState{tc r1oms}\r\n model{tv t4H} [tv]\r\n (main:Darcs.Witnesses.Ordered.FL{tc\r\nr1iNn} prim{tv t4D} [tv]\r\n main:Darcs.Witnesses.Ordered.:>{tc\r\nr1iNy} main:Darcs.Witnesses.Ordered.FL{tc r1iNn}\r\n\r\nprim{tv t4D} [tv])>\r\n ghc-prim:GHC.Types.~{(w) tc 31Q}\r\nmain:Darcs.Test.Patch.WithState.WithState{tc r1oms}\r\n (Sym\r\ncobox{v a6AgE} [lid])\r\n\r\n<main:Darcs.Witnesses.Ordered.FL{tc r1iNn}\r\n\r\nprim{tv t4D} [tv]\r\n\r\nmain:Darcs.Witnesses.Ordered.:>{tc r1iNy}\r\nmain:Darcs.Witnesses.Ordered.FL{tc r1iNn}\r\n\r\nprim{tv t4D} [tv]>)\r\n (let {EvBinds{cobox{v a6zY5} [lid]\r\n = cobox{v a6Aho} [lid] `cast`\r\n(<main:Darcs.Test.Patch.WithState.WithState{tc r1oms}\r\n model{tv t4H} [tv]\r\n\r\n(main:Darcs.Witnesses.Ordered.FL{tc r1iNn}\r\n prim{tv t4D} [tv]\r\n\r\nmain:Darcs.Witnesses.Ordered.:>{tc r1iNy}\r\nmain:Darcs.Witnesses.Ordered.FL{tc r1iNn}\r\n\r\nprim{tv t4D} [tv])>\r\n\r\nghc-prim:GHC.Types.~{(w) tc 31Q}\r\nmain:Darcs.Test.Patch.WithState.WithState{tc r1oms}\r\n\r\n(Sym\r\n\r\ncobox{v a6AgE} [lid])\r\n\r\n<main:Darcs.Witnesses.Ordered.FL{tc r1iNn}\r\n\r\nprim{tv t4D} [tv]\r\n\r\nmain:Darcs.Witnesses.Ordered.:>{tc r1iNy}\r\nmain:Darcs.Witnesses.Ordered.FL{tc r1iNn}\r\n\r\nprim{tv t4D} [tv]>)\r\n cobox{v a6zY6} [lid] = CO <t{tv a6zY1} [tv]>}}\r\n cobox{v a6zY5} [lid] <xx{tv a6zY3} [sk]> <yy{tv a6zY4} [sk]>\r\n -> <t{tv a6zY1} [tv]>)\r\n}}}\r\n\r\n\r\nProject + dependencies can be found at http://urchin.earth.li/~ganesh/temp/tcproblem.tar.bz2 (run build.sh).\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/7175Panic when wrongly using a type family as return types for GADTs2019-07-07T18:51:00ZRichard Eisenbergrae@richarde.devPanic when wrongly using a type family as return types for GADTsThe following code causes the following panic:
```
{-# LANGUAGE TypeFamilies, GADTs #-}
type family F a
data G1 a where
G1C :: F Int
data G2 a where
G2C :: F Int
```
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.6...The following code causes the following panic:
```
{-# LANGUAGE TypeFamilies, GADTs #-}
type family F a
data G1 a where
G1C :: F Int
data G2 a where
G2C :: F Int
```
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.6.0.20120810 for x86_64-apple-darwin):
compiler/typecheck/TcTyClsDecls.lhs:1081:5-62: Irrefutable pattern failed for pattern Data.Maybe.Just subst
```
Admittedly, the code causing the panic is silly, but it happened to me as I was refactoring. Having two separate GADTs with the wrong return types seems necessary to cause the panic.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.6.1-rc1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panic when wrongly using a type family as return types for GADTs","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.6.1-rc1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following code causes the following panic:\r\n\r\n{{{\r\n{-# LANGUAGE TypeFamilies, GADTs #-}\r\n\r\ntype family F a\r\n\r\ndata G1 a where\r\n G1C :: F Int\r\n\r\ndata G2 a where\r\n G2C :: F Int\r\n}}}\r\n\r\n{{{\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.6.0.20120810 for x86_64-apple-darwin):\r\n\tcompiler/typecheck/TcTyClsDecls.lhs:1081:5-62: Irrefutable pattern failed for pattern Data.Maybe.Just subst\r\n}}}\r\n\r\nAdmittedly, the code causing the panic is silly, but it happened to me as I was refactoring. Having two separate GADTs with the wrong return types seems necessary to cause the panic.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/7165"match_co bailing out" messages and compiler crash2019-07-07T18:51:02Zalang"match_co bailing out" messages and compiler crash```
$ cat > Blah.hs
{-# LANGUAGE GADTs #-}
module Blah where
blah :: (dd ~ (Double, Double)) => dd -> dd
blah (ax, bx)
| ax < bx = blah (bx, ax)
| otherwise = (0,0)
$ cat > Meh.hs
module Meh where
import Blah
meh = blah (0,0...```
$ cat > Blah.hs
{-# LANGUAGE GADTs #-}
module Blah where
blah :: (dd ~ (Double, Double)) => dd -> dd
blah (ax, bx)
| ax < bx = blah (bx, ax)
| otherwise = (0,0)
$ cat > Meh.hs
module Meh where
import Blah
meh = blah (0,0)
```
If we compile with -O2, in 2 separate calls to ghc, we get:
```
$ ghc -O2 Blah.hs
[1 of 1] Compiling Blah ( Blah.hs, Blah.o )
match_co baling out
<(ghc-prim:GHC.Types.Double{(w) tc 3u},
ghc-prim:GHC.Types.Double{(w) tc 3u})>
match_co baling out
<(ghc-prim:GHC.Types.Double{(w) tc 3u},
ghc-prim:GHC.Types.Double{(w) tc 3u})>
match_co baling out
<(ghc-prim:GHC.Types.Double{(w) tc 3u},
ghc-prim:GHC.Types.Double{(w) tc 3u})>
match_co baling out
<(ghc-prim:GHC.Types.Double{(w) tc 3u},
ghc-prim:GHC.Types.Double{(w) tc 3u})>
match_co baling out
<(ghc-prim:GHC.Types.Double{(w) tc 3u},
ghc-prim:GHC.Types.Double{(w) tc 3u})>
match_co baling out
<(ghc-prim:GHC.Types.Double{(w) tc 3u},
ghc-prim:GHC.Types.Double{(w) tc 3u})>
$ ghc -O2 Meh.hs
[2 of 2] Compiling Meh ( Meh.hs, Meh.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.2 for x86_64-unknown-linux):
tcIfaceType
Refl
(ghc-prim:GHC.Types.Double{(w) tc 3u},
ghc-prim:GHC.Types.Double{(w) tc 3u})
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"\"match_co bailing out\" messages and compiler crash","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\n$ cat > Blah.hs\r\n{-# LANGUAGE GADTs #-}\r\n\r\nmodule Blah where\r\n\r\nblah :: (dd ~ (Double, Double)) => dd -> dd\r\nblah (ax, bx)\r\n | ax < bx = blah (bx, ax)\r\n | otherwise = (0,0)\r\n\r\n$ cat > Meh.hs\r\nmodule Meh where\r\n\r\nimport Blah\r\n\r\nmeh = blah (0,0)\r\n\r\n}}}\r\n\r\nIf we compile with -O2, in 2 separate calls to ghc, we get:\r\n\r\n{{{\r\n$ ghc -O2 Blah.hs\r\n[1 of 1] Compiling Blah ( Blah.hs, Blah.o )\r\nmatch_co baling out\r\n <(ghc-prim:GHC.Types.Double{(w) tc 3u},\r\n ghc-prim:GHC.Types.Double{(w) tc 3u})>\r\nmatch_co baling out\r\n <(ghc-prim:GHC.Types.Double{(w) tc 3u},\r\n ghc-prim:GHC.Types.Double{(w) tc 3u})>\r\nmatch_co baling out\r\n <(ghc-prim:GHC.Types.Double{(w) tc 3u},\r\n ghc-prim:GHC.Types.Double{(w) tc 3u})>\r\nmatch_co baling out\r\n <(ghc-prim:GHC.Types.Double{(w) tc 3u},\r\n ghc-prim:GHC.Types.Double{(w) tc 3u})>\r\nmatch_co baling out\r\n <(ghc-prim:GHC.Types.Double{(w) tc 3u},\r\n ghc-prim:GHC.Types.Double{(w) tc 3u})>\r\nmatch_co baling out\r\n <(ghc-prim:GHC.Types.Double{(w) tc 3u},\r\n ghc-prim:GHC.Types.Double{(w) tc 3u})>\r\n\r\n$ ghc -O2 Meh.hs\r\n[2 of 2] Compiling Meh ( Meh.hs, Meh.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.4.2 for x86_64-unknown-linux):\r\n\ttcIfaceType\r\n Refl\r\n (ghc-prim:GHC.Types.Double{(w) tc 3u},\r\n ghc-prim:GHC.Types.Double{(w) tc 3u})\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/7128Panic "lookupVarEnv_NF" when using a functional dependency with a kind variable2019-07-07T18:51:15ZRichard Eisenbergrae@richarde.devPanic "lookupVarEnv_NF" when using a functional dependency with a kind variableThe following code causes a panic:
```
{-# LANGUAGE PolyKinds, DataKinds, MultiParamTypeClasses,
FunctionalDependencies
#-}
class Foo a (b :: k) | a -> k
instance Foo Bool False
```
The error is
```
ghc-stage2: panic! (...The following code causes a panic:
```
{-# LANGUAGE PolyKinds, DataKinds, MultiParamTypeClasses,
FunctionalDependencies
#-}
class Foo a (b :: k) | a -> k
instance Foo Bool False
```
The error is
```
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 7.7.20120807 for x86_64-apple-darwin):
lookupVarEnv_NF: Nothing
```
In previous versions of GHC 7.5.x, a functional dependency of this nature worked just fine and had the expected behavior of fixing the value of `k` once `a` was known. It's unclear to me whether this should compile or not, but it shouldn't cause a panic. I believe that my code that used the functional dependency could use `a -> b` in place of `a -> k` with no ill effect, so turning this into an error is not a problem.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panic \"lookupVarEnv_NF\" when using a functional dependency with a kind variable","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.5","keywords":["FunctionalDependencies","PolyKinds"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following code causes a panic:\r\n\r\n{{{\r\n{-# LANGUAGE PolyKinds, DataKinds, MultiParamTypeClasses,\r\n FunctionalDependencies\r\n #-}\r\n\r\nclass Foo a (b :: k) | a -> k\r\ninstance Foo Bool False\r\n}}}\r\n\r\nThe error is \r\n\r\n{{{\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 7.7.20120807 for x86_64-apple-darwin):\r\n\tlookupVarEnv_NF: Nothing\r\n}}}\r\n\r\nIn previous versions of GHC 7.5.x, a functional dependency of this nature worked just fine and had the expected behavior of fixing the value of {{{k}}} once {{{a}}} was known. It's unclear to me whether this should compile or not, but it shouldn't cause a panic. I believe that my code that used the functional dependency could use {{{a -> b}}} in place of {{{a -> k}}} with no ill effect, so turning this into an error is not a problem.","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/7124polykinds tests failing2019-07-07T18:51:16Zpcapriottipolykinds tests failingSome of the `polykinds` tests are failing with `-fhpc` with core lint errors, namely:
- `Freeman`
- `PolyKinds13`
- `T6015`Some of the `polykinds` tests are failing with `-fhpc` with core lint errors, namely:
- `Freeman`
- `PolyKinds13`
- `T6015`7.6.1Simon Peyton JonesSimon Peyton Joneshttps://gitlab.haskell.org/ghc/ghc/-/issues/7094Irrefutable pattern failed for pattern Data.Maybe.Just2022-04-29T10:39:00ZpganelinIrrefutable pattern failed for pattern Data.Maybe.JustThe following invalid program causes ghc panic
```
-----------------------
--State-Monad.hs
data Term = Con Int
| Div Term Term
deriving (Show)
type M a = State -> (a,State)
type State =Int
instance Monad Int -> (a,Int) wh...The following invalid program causes ghc panic
```
-----------------------
--State-Monad.hs
data Term = Con Int
| Div Term Term
deriving (Show)
type M a = State -> (a,State)
type State =Int
instance Monad Int -> (a,Int) where
g >>= f = undefined
return = undefined
-------------------------------
```
```
D:\>"C:\Free\Haskell Platform\2012.2.0.0\bin\ghc.exe" D:\State-Monad.hs
[1 of 1] Compiling Main ( D:\State-Monad.hs, D:\State-Monad.o )
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.4.1 for i386-unknown-mingw32):
compiler\rename\RnSource.lhs:429:14-81: Irrefutable pattern failed for pattern Data.Maybe.Just (inst_tyvars,
_,
SrcLoc.L _ cls,
_)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/7090Panic "mkCoVarLCo" with ConstraintKinds and type-level equality2019-07-07T18:51:24ZRichard Eisenbergrae@richarde.devPanic "mkCoVarLCo" with ConstraintKinds and type-level equalityThe following abuse of the type system causes a panic:
```
{-# LANGUAGE TypeFamilies, DataKinds, ScopedTypeVariables, TypeOperators #-}
import Data.Constraint
data Nat = Zero | Succ Nat
type family Plus (a :: Nat) (b :: Nat) :: Nat
t...The following abuse of the type system causes a panic:
```
{-# LANGUAGE TypeFamilies, DataKinds, ScopedTypeVariables, TypeOperators #-}
import Data.Constraint
data Nat = Zero | Succ Nat
type family Plus (a :: Nat) (b :: Nat) :: Nat
type instance Plus Zero b = b
type instance Plus (Succ a) b = Succ (Plus a b)
type One = Succ Zero
type family (a :: Nat) :==: (b :: Nat) :: Bool
boolToProp :: (a :==: b) ~ True => Dict (a ~ b)
boolToProp = undefined
foo :: forall n. (Succ n :==: Plus n One) ~ True => ()
foo = case (boolToProp :: Dict (Succ n ~ Plus n One)) of
Dict -> ()
```
Here is the error message:
```
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 7.7.20120720 for x86_64-apple-darwin):
mkCoVarLCo
<<details unavailable>>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panic \"mkCoVarLCo\" with ConstraintKinds and type-level equality","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.5","keywords":["ConstraintKinds"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following abuse of the type system causes a panic:\r\n\r\n{{{\r\n{-# LANGUAGE TypeFamilies, DataKinds, ScopedTypeVariables, TypeOperators #-}\r\n\r\nimport Data.Constraint\r\n\r\ndata Nat = Zero | Succ Nat\r\n\r\ntype family Plus (a :: Nat) (b :: Nat) :: Nat\r\ntype instance Plus Zero b = b\r\ntype instance Plus (Succ a) b = Succ (Plus a b)\r\n\r\ntype One = Succ Zero\r\n\r\ntype family (a :: Nat) :==: (b :: Nat) :: Bool\r\n\r\nboolToProp :: (a :==: b) ~ True => Dict (a ~ b)\r\nboolToProp = undefined\r\n\r\nfoo :: forall n. (Succ n :==: Plus n One) ~ True => ()\r\nfoo = case (boolToProp :: Dict (Succ n ~ Plus n One)) of\r\n Dict -> ()\r\n}}}\r\n\r\nHere is the error message:\r\n\r\n{{{\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 7.7.20120720 for x86_64-apple-darwin):\r\n\tmkCoVarLCo\r\n<<details unavailable>>\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1dimitrisdimitrishttps://gitlab.haskell.org/ghc/ghc/-/issues/7042large exponents cannot be compiled2019-07-07T18:51:39ZChristian Maederlarge exponents cannot be compiled```
main = print 1E1000000000
```
cannot be compiled (memory will be exhausted)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7...```
main = print 1E1000000000
```
cannot be compiled (memory will be exhausted)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | #3897, #7034 |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"large exponents cannot be compiled","status":"New","operating_system":"","component":"Compiler","related":[3897,7034],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\nmain = print 1E1000000000\r\n}}}\r\n\r\ncannot be compiled (memory will be exhausted)","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1pcapriottipcapriottihttps://gitlab.haskell.org/ghc/ghc/-/issues/6073Lower case character in deriving statement crashes GHC 7.4.12019-07-07T18:52:19ZExternalRealityLower case character in deriving statement crashes GHC 7.4.1-- Good
newtype Address = Address Text
> deriving (Show, Eq)
-- Boom
newtype Address = Address Text
> deriving (Show,x Eq)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| -------------------...-- Good
newtype Address = Address Text
> deriving (Show, Eq)
-- Boom
newtype Address = Address Text
> deriving (Show,x Eq)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Lower case character in deriving statement crashes GHC 7.4.1","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"-- Good\r\n\r\nnewtype Address = Address Text \r\n deriving (Show, Eq)\r\n\r\n-- Boom\r\n\r\nnewtype Address = Address Text \r\n deriving (Show,x Eq)","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/6060the 'impossible' happened2019-07-07T18:52:22ZLevent Erkökthe 'impossible' happened```
$ cat bug.hs
foo = do let bad = [True | x <- [] | y <- []]
$ ghc bug.hs
[1 of 1] Compiling Main ( bug.hs, bug.o )
bug.hs:1:10:ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for x86_64-apple-darwin):
Prel...```
$ cat bug.hs
foo = do let bad = [True | x <- [] | y <- []]
$ ghc bug.hs
[1 of 1] Compiling Main ( bug.hs, bug.o )
bug.hs:1:10:ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for x86_64-apple-darwin):
Prelude.undefined
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"the 'impossible' happened","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"\r\n{{{\r\n$ cat bug.hs \r\nfoo = do let bad = [True | x <- [] | y <- []]\r\n$ ghc bug.hs \r\n[1 of 1] Compiling Main ( bug.hs, bug.o )\r\n\r\nbug.hs:1:10:ghc: panic! (the 'impossible' happened)\r\n (GHC version 7.4.1 for x86_64-apple-darwin):\r\n\tPrelude.undefined\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/6013the 'impossible' happened2019-07-07T18:52:35Ztlvbthe 'impossible' happenedPlease forgive me if this is a duplicate or irrelevant, bug reporting and Haskell are two things I work with seldom enough that I cannot be considered good at either, but as what happened should be 'impossible' I thought I'd at least giv...Please forgive me if this is a duplicate or irrelevant, bug reporting and Haskell are two things I work with seldom enough that I cannot be considered good at either, but as what happened should be 'impossible' I thought I'd at least give you a heads up. I tried looking for similar bugs, but I do not really know what I would be looking for...
GHCi (newly opened, -v flag):
```
[leo@derse brutelift]$ ghci -v
GHCi, version 7.4.1: http://www.haskell.org/ghc/ :? for help
Glasgow Haskell Compiler, Version 7.4.1, stage 2 booted by GHC version 7.4.1
Using binary package database: /usr/lib/ghc-7.4.1/package.conf.d/package.cache
wired-in package ghc-prim mapped to ghc-prim-0.2.0.0-c2ff696e5b8ec4d4b2bc2e42085fe471
wired-in package integer-gmp mapped to integer-gmp-0.4.0.0-3cccac07aef8e27023f605c1f45bdf74
wired-in package base mapped to base-4.5.0.0-40b99d05fae6a4eea95ea69e6e0c9702
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.7.0.0-8c8cd20e21666657195efabced685fe1
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: -static
Loading package ghc-prim ... linking ... done.
*** gcc:
'/usr/bin/gcc' '-fno-stack-protector' '-Wl,--hash-size=31' '-Wl,--reduce-memory-overheads' '-L/usr/lib/ghc-7.4.1/integer-gmp-0.4.0.0' '--print-file-name' 'libgmp.so'
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :load brutelift
*** Chasing dependencies:
Chasing modules from:
Stable obj: []
Stable BCO: []
unload: retaining objs []
unload: retaining bcos []
Ready for upsweep []
Upsweep completely successful.
*** Deleting temp files:
Deleting:
*** Chasing dependencies:
Chasing modules from: *brutelift.hs
Stable obj: []
Stable BCO: []
unload: retaining objs []
unload: retaining bcos []
Ready for upsweep
[NONREC
ModSummary {
ms_hs_date = Tue Apr 17 18:10:32 CEST 2012
ms_mod = main:Main,
ms_textual_imps = [import (implicit) Prelude, import Data.List]
ms_srcimps = []
}]
*** Deleting temp files:
Deleting:
compile: input file brutelift.hs
Created temporary directory: /tmp/ghc5399_0
*** Checking old interface for main:Main:
[1 of 1] Compiling Main ( brutelift.hs, interpreted )
*** Parser:
*** Renamer/typechecker:
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for x86_64-unknown-linux):
nameModule show{tv abQ}
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
```
brutelift.hs:
```
import Data.List
data Transfer = Load | Unload
data Action = Left Transfer Int | Right Transfer Int
data BlockDispersion = Blocks {top :: [Int]
, bottom :: [Int]
, left :: [Int]
, right :: [Int]}
deriving (Show)
data Machine = MOK BlockDispersion [Action] | MError BlockDispersion [Action] deriving (show)
rSplitAt i xs = let (a, b) = splitAt i $ reverse xs in
(reverse b, reverse a)
moveR :: Int -> ([a], [a]) -> ([a], [a])
moveR i (a, b) = let (c, d) = rSplitAt i a
in (c, d++b)
moveL :: Int -> ([a], [a]) -> ([a], [a])
moveL i (a, b) = let (c, d) = splitAt i b
in (a++c, d)
```
I am not sure what additional info to provide...
Running an Arch linux system, 8GB ram, installed ghc packgage should be as vanilla as can be...
```
[leo@derse brutelift]$ uname -a
Linux derse 3.3.1-1-ARCH #1 SMP PREEMPT Tue Apr 3 06:46:17 UTC 2012 x86_64 Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz GenuineIntel GNU/Linux
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | GhciCrash |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"the 'impossible' happened","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":["checker,","impossible,","panic,","renamer","type"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Please forgive me if this is a duplicate or irrelevant, bug reporting and Haskell are two things I work with seldom enough that I cannot be considered good at either, but as what happened should be 'impossible' I thought I'd at least give you a heads up. I tried looking for similar bugs, but I do not really know what I would be looking for...\r\n\r\nGHCi (newly opened, -v flag):\r\n{{{\r\n[leo@derse brutelift]$ ghci -v\r\nGHCi, version 7.4.1: http://www.haskell.org/ghc/ :? for help\r\nGlasgow Haskell Compiler, Version 7.4.1, stage 2 booted by GHC version 7.4.1\r\nUsing binary package database: /usr/lib/ghc-7.4.1/package.conf.d/package.cache\r\nwired-in package ghc-prim mapped to ghc-prim-0.2.0.0-c2ff696e5b8ec4d4b2bc2e42085fe471\r\nwired-in package integer-gmp mapped to integer-gmp-0.4.0.0-3cccac07aef8e27023f605c1f45bdf74\r\nwired-in package base mapped to base-4.5.0.0-40b99d05fae6a4eea95ea69e6e0c9702\r\nwired-in package rts mapped to builtin_rts\r\nwired-in package template-haskell mapped to template-haskell-2.7.0.0-8c8cd20e21666657195efabced685fe1\r\nwired-in package dph-seq not found.\r\nwired-in package dph-par not found.\r\nHsc static flags: -static\r\nLoading package ghc-prim ... linking ... done.\r\n*** gcc:\r\n'/usr/bin/gcc' '-fno-stack-protector' '-Wl,--hash-size=31' '-Wl,--reduce-memory-overheads' '-L/usr/lib/ghc-7.4.1/integer-gmp-0.4.0.0' '--print-file-name' 'libgmp.so'\r\nLoading package integer-gmp ... linking ... done.\r\nLoading package base ... linking ... done.\r\nPrelude> :load brutelift\r\n*** Chasing dependencies:\r\nChasing modules from: \r\nStable obj: []\r\nStable BCO: []\r\nunload: retaining objs []\r\nunload: retaining bcos []\r\nReady for upsweep []\r\nUpsweep completely successful.\r\n*** Deleting temp files:\r\nDeleting: \r\n*** Chasing dependencies:\r\nChasing modules from: *brutelift.hs\r\nStable obj: []\r\nStable BCO: []\r\nunload: retaining objs []\r\nunload: retaining bcos []\r\nReady for upsweep\r\n [NONREC\r\n ModSummary {\r\n ms_hs_date = Tue Apr 17 18:10:32 CEST 2012\r\n ms_mod = main:Main,\r\n ms_textual_imps = [import (implicit) Prelude, import Data.List]\r\n ms_srcimps = []\r\n }]\r\n*** Deleting temp files:\r\nDeleting: \r\ncompile: input file brutelift.hs\r\nCreated temporary directory: /tmp/ghc5399_0\r\n*** Checking old interface for main:Main:\r\n[1 of 1] Compiling Main ( brutelift.hs, interpreted )\r\n*** Parser:\r\n*** Renamer/typechecker:\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.4.1 for x86_64-unknown-linux):\r\n\tnameModule show{tv abQ}\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n>\r\n}}}\r\n\r\nbrutelift.hs:\r\n\r\n{{{\r\nimport Data.List\r\n\r\ndata Transfer = Load | Unload\r\ndata Action = Left Transfer Int | Right Transfer Int\r\n\r\ndata BlockDispersion = Blocks {top :: [Int]\r\n\t\t\t\t, bottom :: [Int]\r\n\t\t\t\t, left :: [Int]\r\n\t\t\t\t, right :: [Int]}\r\n\t\t\t\tderiving (Show)\r\n\r\ndata Machine = MOK BlockDispersion [Action] | MError BlockDispersion [Action] deriving (show)\r\n\r\n\r\nrSplitAt i xs = let (a, b) = splitAt i $ reverse xs in\r\n\t(reverse b, reverse a)\r\n\t\r\nmoveR :: Int -> ([a], [a]) -> ([a], [a])\r\nmoveR i (a, b) = let (c, d) = rSplitAt i a\r\n\t\t\tin (c, d++b)\r\nmoveL :: Int -> ([a], [a]) -> ([a], [a])\r\nmoveL i (a, b) = let (c, d) = splitAt i b\r\n\t\t\tin (a++c, d)\r\n}}}\r\n\r\n\r\nI am not sure what additional info to provide...\r\nRunning an Arch linux system, 8GB ram, installed ghc packgage should be as vanilla as can be...\r\n\r\n{{{\r\n[leo@derse brutelift]$ uname -a\r\nLinux derse 3.3.1-1-ARCH #1 SMP PREEMPT Tue Apr 3 06:46:17 UTC 2012 x86_64 Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz GenuineIntel GNU/Linux\r\n}}}\r\n\r\n","type_of_failure":"GhciCrash","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/6011Panic when using a type synonym2019-07-07T18:52:36Zmm_freakPanic when using a type synonymI'm getting the following "the impossible happened" error when trying to compile the code in the attachment:
```
[2 of 3] Compiling Data.Mod.FiniteRing ( Data/Mod/FiniteRing.hs, dist/build/Data/Mod/FiniteRing.o )
ghc: panic! (the 'impos...I'm getting the following "the impossible happened" error when trying to compile the code in the attachment:
```
[2 of 3] Compiling Data.Mod.FiniteRing ( Data/Mod/FiniteRing.hs, dist/build/Data/Mod/FiniteRing.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for x86_64-unknown-linux):
tyThingTyCon
Data constructor `modular-0.1.0:Data.Mod.Types.FiniteRing{d r0}'
```
This only happens when I use the Mod type synonym. When I spell the full GenMod type everything works fine. Also the first compilation run after a "cabal clean" works fine.
Steps to reproduce:
1. Unpack the attached cabal package.
1. Compile (cabal configure, cabal build).
1. Touch Data/Mod/FiniteRing.hs.
1. Compile again (cabal build).
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panic when using a type synonym","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I'm getting the following \"the impossible happened\" error when trying to compile the code in the attachment:\r\n\r\n{{{\r\n[2 of 3] Compiling Data.Mod.FiniteRing ( Data/Mod/FiniteRing.hs, dist/build/Data/Mod/FiniteRing.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.4.1 for x86_64-unknown-linux):\r\n\ttyThingTyCon\r\n Data constructor `modular-0.1.0:Data.Mod.Types.FiniteRing{d r0}'\r\n}}}\r\n\r\nThis only happens when I use the Mod type synonym. When I spell the full GenMod type everything works fine. Also the first compilation run after a \"cabal clean\" works fine.\r\n\r\nSteps to reproduce:\r\n\r\n1. Unpack the attached cabal package.\r\n2. Compile (cabal configure, cabal build).\r\n3. Touch Data/Mod/FiniteRing.hs.\r\n4. Compile again (cabal build).","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1pcapriottipcapriottihttps://gitlab.haskell.org/ghc/ghc/-/issues/5961GHC panic (nameModule) on malformed deriving clause2019-07-07T18:52:50ZPhilonousGHC panic (nameModule) on malformed deriving clauseTrying to derive a classname starting with a lower case letter and wrapped in parenthesis will lead to a ghc panic instead of generating an error
minimal testcase:
```
module Foo where
data Foo = Foo deriving (abc)
```
output:
```
[1...Trying to derive a classname starting with a lower case letter and wrapped in parenthesis will lead to a ghc panic instead of generating an error
minimal testcase:
```
module Foo where
data Foo = Foo deriving (abc)
```
output:
```
[1 of 1] Compiling Foo ( scratch3.hs, scratch3.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for x86_64-unknown-linux):
nameModule abc{tv a9I}
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC panic (nameModule) on malformed deriving clause","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Trying to derive a classname starting with a lower case letter and wrapped in parenthesis will lead to a ghc panic instead of generating an error\r\n\r\nminimal testcase:\r\n\r\n{{{\r\nmodule Foo where\r\ndata Foo = Foo deriving (abc)\r\n}}}\r\n\r\noutput: \r\n\r\n{{{\r\n[1 of 1] Compiling Foo ( scratch3.hs, scratch3.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.4.1 for x86_64-unknown-linux):\r\n nameModule abc{tv a9I}\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n}}}\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/5951Panic on Malformed instance A => B => C2019-07-07T18:52:52Zbr1@internet.com.uyPanic on Malformed instance A => B => Cinstance
A =\>
B =\>
C where
> foo = undefined
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 7.4.1 |
...instance
A =\>
B =\>
C where
> foo = undefined
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | Unknown/Multiple |
</details>
<!-- {"blocked_by":[],"summary":"Panic on Malformed instance A => B => C","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"Unknown/Multiple","cc":[""],"type":"Bug","description":"instance\r\n A =>\r\n B => \r\n C where\r\n foo = undefined\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/5934ghc: panic! (the 'impossible' happened)2022-01-31T20:49:43Zguestghc: panic! (the 'impossible' happened)GHC asked me nicely to report this compile-time panic / crash.
Minimal code:
```
{-# LANGUAGE Rank2Types #-}
module Foo where
import System.Random.MWC (GenST)
run :: (forall s . GenST s) -> Int
run = 0
```
Output:
```
$ ghc Foo.hs
...GHC asked me nicely to report this compile-time panic / crash.
Minimal code:
```
{-# LANGUAGE Rank2Types #-}
module Foo where
import System.Random.MWC (GenST)
run :: (forall s . GenST s) -> Int
run = 0
```
Output:
```
$ ghc Foo.hs
[1 of 1] Compiling Foo ( Foo.hs, Foo.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for x86_64-unknown-linux):
tcTyVarDetails
( s{tv a10F} [tv] :: ghc-prim:GHC.Prim.*{(w) tc 34d} )
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghc: panic! (the 'impossible' happened)","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"GHC asked me nicely to report this compile-time panic / crash.\r\n\r\nMinimal code:\r\n{{{\r\n{-# LANGUAGE Rank2Types #-}\r\n\r\nmodule Foo where\r\nimport System.Random.MWC (GenST)\r\nrun :: (forall s . GenST s) -> Int\r\nrun = 0\r\n}}}\r\n\r\nOutput:\r\n\r\n{{{\r\n$ ghc Foo.hs \r\n[1 of 1] Compiling Foo ( Foo.hs, Foo.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.4.1 for x86_64-unknown-linux):\r\n\ttcTyVarDetails\r\n ( s{tv a10F} [tv] :: ghc-prim:GHC.Prim.*{(w) tc 34d} )\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/5768GHC Panic compiling type family with -XPolyKinds2019-07-07T18:53:41ZRichard Eisenbergrae@richarde.devGHC Panic compiling type family with -XPolyKindsI received the following error message:
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.0.20111219 for x86_64-unknown-linux):
tyConKind ghc-prim:GHC.Prim.BOX{(w) tc 347}
```
I was compiling the following code:
`...I received the following error message:
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.0.20111219 for x86_64-unknown-linux):
tyConKind ghc-prim:GHC.Prim.BOX{(w) tc 347}
```
I was compiling the following code:
```
{-# LANGUAGE TypeFamilies,
PolyKinds,
ScopedTypeVariables
#-}
convert :: a -> b
convert = undefined
type family Foo a
bar :: forall a b. b -> (Foo a)
bar f = (convert f :: (Foo a))
```
Interestingly, the output is different when changing the order in the forall (forall b a produces a different error). The same result happened on Linux/x86_64 and MacOS 10.7.2/x86_64-apple-darwin,
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1-rc1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC Panic compiling type family with -XPolyKinds","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1-rc1","keywords":["PolyKinds"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I received the following error message:\r\n\r\n\r\n{{{\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.4.0.20111219 for x86_64-unknown-linux):\r\n tyConKind ghc-prim:GHC.Prim.BOX{(w) tc 347}\r\n}}}\r\n\r\n\r\nI was compiling the following code:\r\n\r\n{{{\r\n{-# LANGUAGE TypeFamilies,\r\n PolyKinds,\r\n ScopedTypeVariables\r\n #-}\r\n\r\nconvert :: a -> b\r\nconvert = undefined\r\n\r\ntype family Foo a\r\n\r\nbar :: forall a b. b -> (Foo a)\r\nbar f = (convert f :: (Foo a))\r\n}}}\r\n\r\n\r\nInterestingly, the output is different when changing the order in the forall (forall b a produces a different error). The same result happened on Linux/x86_64 and MacOS 10.7.2/x86_64-apple-darwin,","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1dreixeldreixelhttps://gitlab.haskell.org/ghc/ghc/-/issues/5752<<loop>> when using variables in TH splice2019-07-07T18:53:45Zsrl<<loop>> when using variables in TH spliceWhen compiling the attached (which uses a variable 'x' in a TH splice in a data decl), the following error is given:
\[1 of 1\] Compiling Main ( b.hs, b.o )
b.hs:11:80:ghc: panic! (the 'impossible' happened)
> (GHC version 7.0.3 for x...When compiling the attached (which uses a variable 'x' in a TH splice in a data decl), the following error is given:
\[1 of 1\] Compiling Main ( b.hs, b.o )
b.hs:11:80:ghc: panic! (the 'impossible' happened)
> (GHC version 7.0.3 for x86_64-unknown-linux):
\<\<loop\>\>
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 7.0.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Template Haskell |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"<<loop>> when using variables in TH splice","status":"New","operating_system":"","component":"Template Haskell","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.0.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"When compiling the attached (which uses a variable 'x' in a TH splice in a data decl), the following error is given:\r\n\r\n[1 of 1] Compiling Main ( b.hs, b.o )\r\n\r\nb.hs:11:80:ghc: panic! (the 'impossible' happened)\r\n (GHC version 7.0.3 for x86_64-unknown-linux):\r\n\t<<loop>>\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/5730unicode characters in cabal path leads to package installation failure2019-07-07T18:53:51Zguestunicode characters in cabal path leads to package installation failureon windows xp/7/8 when path to local cabal packages contains russian unicode characters, some of packages with dependencies fail to link.
local cabal install path is in user directory on windows,
like C:\\Documents and Settings\\леново\...on windows xp/7/8 when path to local cabal packages contains russian unicode characters, some of packages with dependencies fail to link.
local cabal install path is in user directory on windows,
like C:\\Documents and Settings\\леново\\Application Data\\cabal\\
and ghc fails like this:
```
loadObj "C:\\Documents and Settings\\\1083\1077\1085\1086\1074\1086\\Application Data\\cabal\\primitive-0.4.0.1\\ghc-7.0.4\\HSprimitive-0.4.0.1.o": failed
```
some of packages that fail:
vector
alex
not works on haskell platform 2011.4.0.0, 2011.2.0.1
log:
```
C:\Documents and Settings\леново>cabal install vector
Resolving dependencies...
...
Installing library in C:\Documents and Settings\леново\Application
Data\cabal\primitive-0.4.0.1\ghc-7.0.4
Registering primitive-0.4.0.1...
Downloading vector-0.9...
Configuring vector-0.9...
Preprocessing library vector-0.9...
Building vector-0.9...
...
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package primitive-0.4.0.1 ... ghc.exe: panic! (the 'impossible' happened
)
(GHC version 7.0.4 for i386-unknown-mingw32):
loadObj "C:\\Documents and Settings\\\1083\1077\1085\1086\1074\1086\\Application Data\\cabal\\primitive-0.4.0.1\\ghc-7.0.4\\HSprimitive-0.4.0.1.o": failed
```7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/5486LLVM can't compile HsOpenSSL2019-07-07T18:55:04ZdtereiLLVM can't compile HsOpenSSL```
> ...
> [10 of 31] Compiling OpenSSL.BIO ( dist/build/OpenSSL/IO.hs, dist/build/OpenSSL/BIO.o )
> [11 of 31] Compiling OpenSSL.Random ( dist/build/OpenSSL/Random.hs, dist/build/OpenSSL/Random.o )
> [12 of 31] Compiling OpenSSL...```
> ...
> [10 of 31] Compiling OpenSSL.BIO ( dist/build/OpenSSL/IO.hs, dist/build/OpenSSL/BIO.o )
> [11 of 31] Compiling OpenSSL.Random ( dist/build/OpenSSL/Random.hs, dist/build/OpenSSL/Random.o )
> [12 of 31] Compiling OpenSSL.BN ( dist/build/OpenSSL/BN.hs, dist/build/OpenSSL/BN.o )
>
> OpenSSL/BN.hsc:46:1:
> Warning: In the use of `unsafePerformIO'
> (imported from Foreign):
> Deprecated: "Use System.IO.Unsafe.unsafePerformIO instead; This function will be removed in the next release"
> [13 of 31] Compiling OpenSSL.DSA ( dist/build/OpenSSL/DSA.hs, dist/build/OpenSSL/DSA.o )
>
> OpenSSL/DSA.hsc:37:1:
> Warning: In the use of `unsafePerformIO'
> (imported from Foreign):
> Deprecated: "Use System.IO.Unsafe.unsafePerformIO instead; This function will be removed in the next release"
> opt: /tmp/ghc18807_0/ghc18807_0.ll:20051:1: error: instructions returning void cannot have a name
> %lnPRJ = call ccc void (i8*,i8*,i32)* @memcpy( i8* %lnPRF, i8* %lnPRH, i32 %lnPRI ) nounwind
> ^
```
Also seems to be some mangler problems.7.6.1dtereidterei