GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:17:28Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/14325Erroneous program emits no errors2019-07-07T18:17:28ZSimon Peyton JonesErroneous program emits no errorsConsider this (which arose in #14323):
```
class (a~b) => C a b
foo :: C a b => a -> b
foo x = x
hm3 :: C (f b) b => b -> f b
hm3 x = foo x
```
With GHC 8.2 it compiles without error, but it definitely has a type error; try `-ddump-s...Consider this (which arose in #14323):
```
class (a~b) => C a b
foo :: C a b => a -> b
foo x = x
hm3 :: C (f b) b => b -> f b
hm3 x = foo x
```
With GHC 8.2 it compiles without error, but it definitely has a type error; try `-ddump-simpl`:
```
hm3 :: forall (f :: * -> *) b. C (f b) b => b -> f b
[GblId, Arity=2, Str=<L,U><L,U>x]
hm3
= \ (@ (f_a126 :: * -> *))
(@ b_a127)
($dC_a129 :: C (f_a126 b_a127) b_a127)
_ [Occ=Dead] ->
case GHC.Types.HEq_sc
@ *
@ *
@ (f_a126 b_a127)
@ b_a127
($dC_a129
`cast` ((T14323.N:C[0] ; Data.Type.Equality.N:~[0]
<*>_N) <f_a126 b_a127>_N <b_a127>_N
:: (C (f_a126 b_a127) b_a127 :: Constraint)
~R# ((f_a126 b_a127 :: *) ~~ (b_a127 :: *) :: Constraint)))
of cobox_a12p
{ __DEFAULT ->
case Control.Exception.Base.typeError
@ 'GHC.Types.LiftedRep
@ (C b_a127 (f_a126 b_a127))
"T14323.hs:28:9: error:\n\
\ \\226\\128\\162 Could not deduce (C b (f b)) arising from a use of \\226\\128\\152foo\\226\\128\\153\n\
\ from the context: C (f b) b\n\
\ bound by the type signature for:\n\
\ hm3 :: forall (f :: * -> *) b. C (f b) b => b -> f b\n\
\ at T14323.hs:27:1-28\n\
\ \\226\\128\\162 In the expression: foo x\n\
\ In an equation for \\226\\128\\152hm3\\226\\128\\153: hm3 x = foo x\n\
\(deferred type error)"#
of wild_00 {
}
}
```
Reason: bug in the error suppression logic in `TcErrors`
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.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":"Erroneous program emits no errors","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Consider this (which arose in #14323):\r\n{{{\r\nclass (a~b) => C a b\r\n\r\nfoo :: C a b => a -> b\r\nfoo x = x\r\n\r\nhm3 :: C (f b) b => b -> f b\r\nhm3 x = foo x\r\n}}}\r\nWith GHC 8.2 it compiles without error, but it definitely has a type error; try `-ddump-simpl`:\r\n{{{\r\nhm3 :: forall (f :: * -> *) b. C (f b) b => b -> f b\r\n[GblId, Arity=2, Str=<L,U><L,U>x]\r\nhm3\r\n = \\ (@ (f_a126 :: * -> *))\r\n (@ b_a127)\r\n ($dC_a129 :: C (f_a126 b_a127) b_a127)\r\n _ [Occ=Dead] ->\r\n case GHC.Types.HEq_sc\r\n @ *\r\n @ *\r\n @ (f_a126 b_a127)\r\n @ b_a127\r\n ($dC_a129\r\n `cast` ((T14323.N:C[0] ; Data.Type.Equality.N:~[0]\r\n <*>_N) <f_a126 b_a127>_N <b_a127>_N\r\n :: (C (f_a126 b_a127) b_a127 :: Constraint)\r\n ~R# ((f_a126 b_a127 :: *) ~~ (b_a127 :: *) :: Constraint)))\r\n of cobox_a12p\r\n { __DEFAULT ->\r\n case Control.Exception.Base.typeError\r\n @ 'GHC.Types.LiftedRep\r\n @ (C b_a127 (f_a126 b_a127))\r\n \"T14323.hs:28:9: error:\\n\\\r\n \\ \\\\226\\\\128\\\\162 Could not deduce (C b (f b)) arising from a use of \\\\226\\\\128\\\\152foo\\\\226\\\\128\\\\153\\n\\\r\n \\ from the context: C (f b) b\\n\\\r\n \\ bound by the type signature for:\\n\\\r\n \\ hm3 :: forall (f :: * -> *) b. C (f b) b => b -> f b\\n\\\r\n \\ at T14323.hs:27:1-28\\n\\\r\n \\ \\\\226\\\\128\\\\162 In the expression: foo x\\n\\\r\n \\ In an equation for \\\\226\\\\128\\\\152hm3\\\\226\\\\128\\\\153: hm3 x = foo x\\n\\\r\n \\(deferred type error)\"#\r\n of wild_00 {\r\n }\r\n }\r\n}}}\r\nReason: bug in the error suppression logic in `TcErrors`","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14308GHC panic with invalid expression2019-07-07T18:17:32Zd6eGHC panic with invalid expressionHi, I recently discovered this expression causes GHC to panic. Shouldn't it handle this more gracefully? Perhaps saying something like "That expression is not valid. \<Further Explanation\>"
Invalid expression:
```hs
g :: (a->b) a
```
...Hi, I recently discovered this expression causes GHC to panic. Shouldn't it handle this more gracefully? Perhaps saying something like "That expression is not valid. \<Further Explanation\>"
Invalid expression:
```hs
g :: (a->b) a
```
```
Prelude> g :: (a->b) a
ghc: panic! (the 'impossible' happened)
(GHC version 8.2.1 for x86_64-apple-darwin):
repSplitAppTys
a_a1Lz[sk:1]
b_a1LA[sk:1]
[]
Call stack:
CallStack (from HasCallStack):
prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | MacOS X |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC panic with invalid expression","status":"New","operating_system":"MacOS X","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"\r\nHi, I recently discovered this expression causes GHC to panic. Shouldn't it handle this more gracefully? Perhaps saying something like \"That expression is not valid. <Further Explanation>\"\r\n\r\nInvalid expression:\r\n{{{#!hs\r\ng :: (a->b) a\r\n}}}\r\n\r\n\r\n{{{\r\nPrelude> g :: (a->b) a\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.2.1 for x86_64-apple-darwin):\r\n\trepSplitAppTys\r\n a_a1Lz[sk:1]\r\n b_a1LA[sk:1]\r\n []\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable\r\n callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type\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":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14305Missing COMPLETE pragmas in release notes for version 8.2.12019-07-07T18:17:32ZAndrés Sicard-RamírezMissing COMPLETE pragmas in release notes for version 8.2.1From comment [ticket:8779\#comment:131378](https://gitlab.haskell.org//ghc/ghc/issues/8779#note_131378) it seems `COMPLETE` pragmas were added in 8.2.1 but I couldn't find them in its [release notes](https://downloads.haskell.org/~ghc/8....From comment [ticket:8779\#comment:131378](https://gitlab.haskell.org//ghc/ghc/issues/8779#note_131378) it seems `COMPLETE` pragmas were added in 8.2.1 but I couldn't find them in its [release notes](https://downloads.haskell.org/~ghc/8.2.1/docs/html/users_guide/8.2.1-notes.html).
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------- |
| Version | 8.2.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Documentation |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Missing COMPLETE pragmas in release notes for version 8.2.1","status":"New","operating_system":"","component":"Documentation","related":[],"milestone":"8.2.2","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"From comment ticket:8779#comment:57 it seems `COMPLETE` pragmas were added in 8.2.1 but I couldn't find them in its [https://downloads.haskell.org/~ghc/8.2.1/docs/html/users_guide/8.2.1-notes.html release notes].\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14304Instantiated libraries (Backpack) don't get linked with enough deps2019-07-07T18:17:33ZEdward Z. YangInstantiated libraries (Backpack) don't get linked with enough depsOne downstream instance of this reported at https://github.com/haskell/cabal/issues/4755
Basically, if you instantiate a library q with library p, you need to make sure libHSp.so shows up in its linker dependencies. This is not the case...One downstream instance of this reported at https://github.com/haskell/cabal/issues/4755
Basically, if you instantiate a library q with library p, you need to make sure libHSp.so shows up in its linker dependencies. This is not the case right now.
Patch coming (I filed this to get a bug number :)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------------ |
| Version | 8.2.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Linking) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Instantiated libraries (Backpack) don't get linked with enough deps","status":"New","operating_system":"","component":"Compiler (Linking)","related":[],"milestone":"8.2.2","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":["backpack"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"One downstream instance of this reported at https://github.com/haskell/cabal/issues/4755\r\n\r\nBasically, if you instantiate a library q with library p, you need to make sure libHSp.so shows up in its linker dependencies. This is not the case right now.\r\n\r\nPatch coming (I filed this to get a bug number :)","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14290Strictness bug with existential contexts on data constructors2019-07-07T18:17:36ZSimon MarlowStrictness bug with existential contexts on data constructorsThe following:
```
{-# LANGUAGE ExistentialQuantification #-}
module Main (main) where
main :: IO ()
main = r `seq` return ()
r :: Rec
r = Rec{ a = error "xxx", b = 3, c = True }
class C t
instance C Bool
data Rec = forall t. C t =...The following:
```
{-# LANGUAGE ExistentialQuantification #-}
module Main (main) where
main :: IO ()
main = r `seq` return ()
r :: Rec
r = Rec{ a = error "xxx", b = 3, c = True }
class C t
instance C Bool
data Rec = forall t. C t => Rec
{ a :: ()
, b :: !Int
, c :: t
}
```
Should succeed, but fails with `error "xxx"` (but only when compiled with `-O`). The problem is that the strictness signature for the data con wrapper doesn't take into account the dictionary fields.
I have a patch which I'll upload to Phabricator shortly...8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14285Entered absent arg - triggered by INLINEABLE, regression from 8.0.22021-03-25T19:37:55Zwaldmann@imn.htwk-leipzig.deEntered absent arg - triggered by INLINEABLE, regression from 8.0.2Steps to reproduce:
```
git clone https://gitlab.imn.htwk-leipzig.de/waldmann/pure-matchbox
git checkout a2005d246cb7bd77a33bf4c09419534bc7ecd435
stack build
.stack-work/install/x86_64-linux/nightly-2017-09-26/8.2.1/bin/pure-matchbox -i...Steps to reproduce:
```
git clone https://gitlab.imn.htwk-leipzig.de/waldmann/pure-matchbox
git checkout a2005d246cb7bd77a33bf4c09419534bc7ecd435
stack build
.stack-work/install/x86_64-linux/nightly-2017-09-26/8.2.1/bin/pure-matchbox -i -w Count data/z001.srs
```
Output:
```
pure-matchbox: Oops! Entered absent arg ww Map k (Set k1)
```
Error goes away when compiling with -O0, or when removing this pragma in src/Matchbox/Pairs.hs
```
52 {-# INLINEABLE pre_images #-}
53 pre_images x rel = images x $ mirrorRel rel
```
(normal output starts with YES on a single line)
Error also goes away when building with 8.0.2
```
PATH=/where/you/have/installed/ghc-8.0.2/bin:$PATH stack build --resolver=lts-9.6
```
I tried to isolate a shorter test case but gave up after some hours. Is there some automation for this?
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.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":"Entered absent arg - triggered by INLINEABLE, regression from 8.0.2","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Steps to reproduce:\r\n{{{\r\ngit clone https://gitlab.imn.htwk-leipzig.de/waldmann/pure-matchbox\r\ngit checkout a2005d246cb7bd77a33bf4c09419534bc7ecd435\r\nstack build\r\n.stack-work/install/x86_64-linux/nightly-2017-09-26/8.2.1/bin/pure-matchbox -i -w Count data/z001.srs\r\n}}}\r\n\r\nOutput:\r\n{{{\r\npure-matchbox: Oops! Entered absent arg ww Map k (Set k1)\r\n}}}\r\n\r\nError goes away when compiling with -O0, or when removing this pragma in src/Matchbox/Pairs.hs\r\n{{{\r\n 52 {-# INLINEABLE pre_images #-}\r\n 53 pre_images x rel = images x $ mirrorRel rel\r\n}}}\r\n\r\n(normal output starts with YES on a single line)\r\n\r\nError also goes away when building with 8.0.2\r\n{{{\r\nPATH=/where/you/have/installed/ghc-8.0.2/bin:$PATH stack build --resolver=lts-9.6\r\n}}}\r\n\r\nI tried to isolate a shorter test case but gave up after some hours. Is there some automation for this?","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14277Missing release version number in <title> in the HTML User's Guide2019-07-07T18:17:39ZrefoldMissing release version number in <title> in the HTML User's GuideSee, for example, here: https://downloads.haskell.org/\~ghc/latest/docs/html/users_guide/flags.html
The `<title>` of that page is `6.6. Flag reference &mdash; Glasgow Haskell Compiler &lt;release&gt; User&#39;s Guide`.
It should use th...See, for example, here: https://downloads.haskell.org/\~ghc/latest/docs/html/users_guide/flags.html
The `<title>` of that page is `6.6. Flag reference — Glasgow Haskell Compiler <release> User's Guide`.
It should use the actual version number (in this case, 8.2.1) instead of the `<release>` placeholder.8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14237-Wredundant-constraints incorrectly treats all type equality constraints as r...2019-07-07T18:17:49ZAlexis King-Wredundant-constraints incorrectly treats all type equality constraints as redundantGHC emits a warning about the following function:
```hs
f :: (Integer ~ a) => a -> Integer
f = (+ 1)
```
```
/private/tmp/redundant-default-constraint/src/RedundantDefaultConstraints.hs:14:1: warning: [-Wredundant-constraints]
• Re...GHC emits a warning about the following function:
```hs
f :: (Integer ~ a) => a -> Integer
f = (+ 1)
```
```
/private/tmp/redundant-default-constraint/src/RedundantDefaultConstraints.hs:14:1: warning: [-Wredundant-constraints]
• Redundant constraint: Integer ~ a
• In the type signature for:
f :: forall a. Integer ~ a => a -> Integer
|
14 | f :: Integer ~ a => a -> Integer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
This is understandable (though the error message could perhaps be better) because the equality is pointless. It would be better to just rewrite the type signature as `Integer -> Integer`.
However, this becomes problematic when combined with `DefaultSignatures`. GHC *also* emits a warning for the following program:
```hs
class Monad m => MonadFoo m where
foo :: m ()
default foo :: (MonadFoo m', MonadTrans t, m ~ t m') => m ()
foo = lift foo
```
```
/private/tmp/redundant-default-constraint/src/RedundantDefaultConstraints.hs:8:18: warning: [-Wredundant-constraints]
• Redundant constraint: m ~ t m'
• In the type signature for:
foo :: forall (m' :: * -> *) (t :: (* -> *) -> * -> *).
(MonadFoo m', MonadTrans t, m ~ t m') =>
m ()
|
8 | default foo :: (MonadFoo m', MonadTrans t, m ~ t m') => m ()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
This is wrong, because the constraint here is necessary. The type equality cannot be “inlined” into the type, since #12918 made that illegal. The constraint cannot be removed entirely, since then the program would fail to typecheck. Therefore, GHC should not produce an error in this case.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.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":"-Wredundant-constraints incorrectly warns about required type equality constraints in default signatures","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"GHC emits a warning about the following function:\r\n\r\n{{{#!hs\r\nf :: (Integer ~ a) => a -> Integer\r\nf = (+ 1)\r\n}}}\r\n{{{\r\n/private/tmp/redundant-default-constraint/src/RedundantDefaultConstraints.hs:14:1: warning: [-Wredundant-constraints]\r\n • Redundant constraint: Integer ~ a\r\n • In the type signature for:\r\n f :: forall a. Integer ~ a => a -> Integer\r\n |\r\n14 | f :: Integer ~ a => a -> Integer\r\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n}}}\r\n\r\nThis is understandable (though the error message could perhaps be better) because the equality is pointless. It would be better to just rewrite the type signature as `Integer -> Integer`.\r\n\r\nHowever, this becomes problematic when combined with `DefaultSignatures`. GHC ''also'' emits a warning for the following program:\r\n\r\n{{{#!hs\r\nclass Monad m => MonadFoo m where\r\n foo :: m ()\r\n\r\n default foo :: (MonadFoo m', MonadTrans t, m ~ t m') => m ()\r\n foo = lift foo\r\n}}}\r\n{{{\r\n/private/tmp/redundant-default-constraint/src/RedundantDefaultConstraints.hs:8:18: warning: [-Wredundant-constraints]\r\n • Redundant constraint: m ~ t m'\r\n • In the type signature for:\r\n foo :: forall (m' :: * -> *) (t :: (* -> *) -> * -> *).\r\n (MonadFoo m', MonadTrans t, m ~ t m') =>\r\n m ()\r\n |\r\n8 | default foo :: (MonadFoo m', MonadTrans t, m ~ t m') => m ()\r\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n}}}\r\n\r\nThis is wrong, because the constraint here is necessary. The type equality cannot be “inlined” into the type, since #12918 made that illegal. The constraint cannot be removed entirely, since then the program would fail to typecheck. Therefore, GHC should not produce an error in this case.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14228PatternSynonyms Non-exhaustive with UnboxedSums2019-07-07T18:17:51ZGuillaume BouchardPatternSynonyms Non-exhaustive with UnboxedSumsThe following implementation of `Maybe` using UnboxedSums results in `Non-exhaustive patterns in case`:
(`Failure.hs` file)
```haskell
{-# LANGUAGE UnboxedSums #-}
{-# LANGUAGE PatternSynonyms #-}
type Maybe' t = (# t | () #)
pattern...The following implementation of `Maybe` using UnboxedSums results in `Non-exhaustive patterns in case`:
(`Failure.hs` file)
```haskell
{-# LANGUAGE UnboxedSums #-}
{-# LANGUAGE PatternSynonyms #-}
type Maybe' t = (# t | () #)
pattern Just' :: a -> Maybe' a
pattern Just' x = (# x | #)
pattern Nothing' :: Maybe' a
pattern Nothing' = (# | () #)
foo x = case x of
Nothing' -> putStrLn "nothing"
Just' _ -> putStrLn "just"
main = do
putStrLn "Nothing'"
foo Nothing'
putStrLn "Just'"
foo (Just' "hello")
```
When executed, it prints:
```
Nothing'
nothing
Just'
Failure: Failure.hs:10:20-29: Non-exhaustive patterns in case
```
Compiled with `ghc Failure.hs`.
Please note that by removing the `pattern`s, and writting `foo` as following works as expected:
```haskell
foo x = case x of
(# | () #) -> putStrLn "nothing"
(# _ | #) -> putStrLn "just"
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.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":"PatternSynonyms Non-exhaustive with UnboxedSums","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":["PatternSynonyms","UnboxedSum,"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following implementation of `Maybe` using UnboxedSums results in `Non-exhaustive patterns in case`:\r\n\r\n(`Failure.hs` file)\r\n\r\n{{{#!haskell\r\n{-# LANGUAGE UnboxedSums #-}\r\n{-# LANGUAGE PatternSynonyms #-}\r\n\r\ntype Maybe' t = (# t | () #)\r\n\r\npattern Just' :: a -> Maybe' a\r\npattern Just' x = (# x | #)\r\n\r\npattern Nothing' :: Maybe' a\r\npattern Nothing' = (# | () #)\r\n\r\nfoo x = case x of\r\n Nothing' -> putStrLn \"nothing\"\r\n Just' _ -> putStrLn \"just\"\r\n\r\nmain = do\r\n putStrLn \"Nothing'\"\r\n foo Nothing'\r\n\r\n putStrLn \"Just'\"\r\n foo (Just' \"hello\")\r\n}}}\r\n\r\nWhen executed, it prints:\r\n\r\n{{{\r\nNothing'\r\nnothing\r\nJust'\r\nFailure: Failure.hs:10:20-29: Non-exhaustive patterns in case\r\n}}}\r\n\r\nCompiled with `ghc Failure.hs`.\r\n\r\nPlease note that by removing the `pattern`s, and writting `foo` as following works as expected:\r\n\r\n{{{#!haskell\r\nfoo x = case x of\r\n (# | () #) -> putStrLn \"nothing\"\r\n (# _ | #) -> putStrLn \"just\"\r\n}}}\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14217Interface-file decls for large tuples2019-07-07T18:17:54ZEric CrockettInterface-file decls for large tuplesI'm in the process of updating a large code base for GHC 8.2, and I have the following error (with -ddump-if-trace):
```
...
Starting fork { Declaration for $fCT2
Loading decl for $fCT2
updating EPS_
Considering whether to load GHC.Prim...I'm in the process of updating a large code base for GHC 8.2, and I have the following error (with -ddump-if-trace):
```
...
Starting fork { Declaration for $fCT2
Loading decl for $fCT2
updating EPS_
Considering whether to load GHC.Prim {- SYSTEM -}
Considering whether to load GHC.Prim {- SYSTEM -}
} ending fork Declaration for $fCT2
Need decl for (%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,%)
Considering whether to load GHC.Classes {- SYSTEM -}
Considering whether to load GHC.Types {- SYSTEM -}
checkWiredInTyCon Double
Crypto.Lol.Applications.Tests.SHETests
Considering whether to load GHC.Types {- SYSTEM -}
Starting fork { Class op ip a ty
} ending fork Class op ip a ty
...
Can't find interface-file declaration for type constructor or class ghc-prim-0.5.1.0:GHC.Classes.(%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,%)
Probable cause: bug in .hi-boot file, or inconsistent .hi file
Use -ddump-if-trace to get an idea of which file caused the error
```
The code in question involves a poly-kinded, promoted 8-tuple, though I have no idea where GHC is coming up with a 64-tuple.
Since I'm updating a large library, I've been unable to produce a small example so far. I can make the code compile by simplifying it in various ways, so aside from this problem, the code works with 8.2.1. This issue is currently preventing me from updating my code base to 8.2.1.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.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":"Interface-file decls for large tuples","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I'm in the process of updating a large code base for GHC 8.2, and I have the following error (with -ddump-if-trace):\r\n\r\n{{{\r\n...\r\nStarting fork { Declaration for $fCT2\r\nLoading decl for $fCT2\r\nupdating EPS_\r\nConsidering whether to load GHC.Prim {- SYSTEM -}\r\nConsidering whether to load GHC.Prim {- SYSTEM -}\r\n} ending fork Declaration for $fCT2\r\nNeed decl for (%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,%)\r\nConsidering whether to load GHC.Classes {- SYSTEM -}\r\nConsidering whether to load GHC.Types {- SYSTEM -}\r\ncheckWiredInTyCon Double\r\nCrypto.Lol.Applications.Tests.SHETests\r\nConsidering whether to load GHC.Types {- SYSTEM -}\r\nStarting fork { Class op ip a ty\r\n} ending fork Class op ip a ty\r\n...\r\n\r\nCan't find interface-file declaration for type constructor or class ghc-prim-0.5.1.0:GHC.Classes.(%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,%)\r\n Probable cause: bug in .hi-boot file, or inconsistent .hi file\r\n Use -ddump-if-trace to get an idea of which file caused the error\r\n}}}\r\n\r\nThe code in question involves a poly-kinded, promoted 8-tuple, though I have no idea where GHC is coming up with a 64-tuple.\r\n\r\nSince I'm updating a large library, I've been unable to produce a small example so far. I can make the code compile by simplifying it in various ways, so aside from this problem, the code works with 8.2.1. This issue is currently preventing me from updating my code base to 8.2.1.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14215Coordinate re Cabal-2.0.0.3 or Cabal-2.0.1 release2019-07-07T18:17:54ZHerbert Valerio Riedelhvr@gnu.orgCoordinate re Cabal-2.0.0.3 or Cabal-2.0.1 release<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.2.1 |
| Type | Task |
| Type...<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.2.1 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | libraries (other) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Coordinate re Cabal-2.0.0.3 or Cabal-2.0.1 release","status":"New","operating_system":"","component":"libraries (other)","related":[],"milestone":"8.2.2","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14199Document Type.Reflection better (Fun and Con')2019-07-07T18:17:59ZDavid FeuerDocument Type.Reflection better (Fun and Con')The pattern synonym `Type.Reflection.Fun` is not documented at all. Since it seems a bit subtle (`(->)` being more than just a type constructor), I think it actually deserves *extra* documentation, with examples.
The pattern synonym `Ty...The pattern synonym `Type.Reflection.Fun` is not documented at all. Since it seems a bit subtle (`(->)` being more than just a type constructor), I think it actually deserves *extra* documentation, with examples.
The pattern synonym `Type.Reflection.Con'` is insufficiently documented. Some examples would probably help.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | bgamari |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Document Type.Reflection better (Fun and Con')","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.2.2","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":["Typeable"],"differentials":[],"test_case":"","architecture":"","cc":["bgamari"],"type":"Bug","description":"The pattern synonym `Type.Reflection.Fun` is not documented at all. Since it seems a bit subtle (`(->)` being more than just a type constructor), I think it actually deserves ''extra'' documentation, with examples.\r\n\r\nThe pattern synonym `Type.Reflection.Con'` is insufficiently documented. Some examples would probably help.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/14197Flag "dump-rn-ast" only dumps the declarations, not the whole RenamedSource2019-07-07T18:18:00ZAlan ZimmermanFlag "dump-rn-ast" only dumps the declarations, not the whole RenamedSource`RenamedSource` is defined as
```hs
type RenamedSource = ( HsGroup Name
, [LImportDecl Name]
, Maybe [LIE Name]
, Maybe LHsDocString)
```
The current behaviour when `dump-r...`RenamedSource` is defined as
```hs
type RenamedSource = ( HsGroup Name
, [LImportDecl Name]
, Maybe [LIE Name]
, Maybe LHsDocString)
```
The current behaviour when `dump-rn-ast` is set is to only dump the first component of this.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.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":"Flag \"dump-rn-ast\" only dumps the declarations, not the whole RenamedSource","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"`RenamedSource` is defined as\r\n\r\n{{{#!hs\r\ntype RenamedSource = ( HsGroup Name\r\n , [LImportDecl Name]\r\n , Maybe [LIE Name]\r\n , Maybe LHsDocString)\r\n}}}\r\n\r\nThe current behaviour when `dump-rn-ast` is set is to only dump the first component of this.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2Alan ZimmermanAlan Zimmermanhttps://gitlab.haskell.org/ghc/ghc/-/issues/14189Renamer does not preserve location for IEThingWith list items2019-07-07T18:18:02ZAlan ZimmermanRenamer does not preserve location for IEThingWith list itemsIn the `RenamedSource` for
```hs
module Renaming.RenameInExportedType
(
MyType (NT)
) where
data MyType = MT Int | NT
```
The `(NT)` is given the location of `MyType` earlier on the line in the export list.
<details><summary>T...In the `RenamedSource` for
```hs
module Renaming.RenameInExportedType
(
MyType (NT)
) where
data MyType = MT Int | NT
```
The `(NT)` is given the location of `MyType` earlier on the line in the export list.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.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":"Renamer does not preserve location for IEThingWith list items","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"In the `RenamedSource` for\r\n\r\n{{{#!hs\r\nmodule Renaming.RenameInExportedType\r\n (\r\n MyType (NT)\r\n ) where\r\n\r\ndata MyType = MT Int | NT\r\n\r\n}}}\r\n\r\nThe `(NT)` is given the location of `MyType` earlier on the line in the export list.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2Alan ZimmermanAlan Zimmermanhttps://gitlab.haskell.org/ghc/ghc/-/issues/14175Panic repSplitTyConApp_maybe2019-07-07T18:18:08ZDavid FeuerPanic repSplitTyConApp_maybeThis definition panics!
```hs
{-# LANGUAGE TypeFamilies, TypeInType #-}
module Whoops where
import Data.Kind
type family PComp (k :: j -> Type) (x :: k) :: ()
```
```
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.3....This definition panics!
```hs
{-# LANGUAGE TypeFamilies, TypeInType #-}
module Whoops where
import Data.Kind
type family PComp (k :: j -> Type) (x :: k) :: ()
```
```
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.3.20170828 for x86_64-unknown-linux):
repSplitTyConApp_maybe
j_aon[sk:1]
*
*
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1138:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:1123:5 in ghc:Type
```
If I make it a type synonym instead, I get a proper error as expected.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.2.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | goldfire |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panic repSplitTyConApp_maybe","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.2.2","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":["goldfire"],"type":"Bug","description":"This definition panics!\r\n\r\n{{{#!hs\r\n{-# LANGUAGE TypeFamilies, TypeInType #-}\r\n\r\nmodule Whoops where\r\nimport Data.Kind\r\n\r\ntype family PComp (k :: j -> Type) (x :: k) :: ()\r\n}}}\r\n\r\n{{{\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.3.20170828 for x86_64-unknown-linux):\r\n repSplitTyConApp_maybe\r\n j_aon[sk:1]\r\n *\r\n *\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1138:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Type.hs:1123:5 in ghc:Type\r\n}}}\r\n\r\nIf I make it a type synonym instead, I get a proper error as expected.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14163Stack Overflow with ApplicativeDo2019-07-07T18:18:12ZlipplingStack Overflow with ApplicativeDoI tried to compile one of our server applications with 8.2.1 (which compiles fine with 8.0.2).
The compilation runs smoothly, but when it reaches a specific file, the RAM usage goes up to \> 20GB pretty fast on my 16GB machine and the G...I tried to compile one of our server applications with 8.2.1 (which compiles fine with 8.0.2).
The compilation runs smoothly, but when it reaches a specific file, the RAM usage goes up to \> 20GB pretty fast on my 16GB machine and the GHC process gets terminated with a stack overflow error.
I tried to find a minimal example that causes this behavior:
```hs
#!/usr/bin/env stack
-- stack --resolver nightly-2017-08-25 script
{-# LANGUAGE ApplicativeDo #-}
x = do
(a, _) <- undefined
(b, _) <- undefined
(c, _) <- undefined
undefined
main = undefined
```
It only happens with at least 3 of these pattern matches.8.2.2Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/14162Core Lint error2019-07-07T18:18:12ZIcelandjackCore Lint error```hs
{-# Options_GHC -dcore-lint #-}
{-# Language TypeOperators, KindSignatures, DataKinds, PolyKinds, TypeFamilies, GADTs, TypeInType #-}
import Data.Kind
data family Sing (a :: k)
data
SubList :: [a] -> [a] -> Type where
SubN...```hs
{-# Options_GHC -dcore-lint #-}
{-# Language TypeOperators, KindSignatures, DataKinds, PolyKinds, TypeFamilies, GADTs, TypeInType #-}
import Data.Kind
data family Sing (a :: k)
data
SubList :: [a] -> [a] -> Type where
SubNil :: SubList '[] '[]
Keep :: SubList xs ys -> SubList (x ': xs) (x ': ys)
Drop :: SubList xs ys -> SubList xs (x ': ys)
data instance
Sing (x :: SubList ys xs) where
SSubNil :: Sing SubNil
SKeep :: Sing x -> Sing (Keep x)
SDrop :: Sing x -> Sing (Drop x)
```
running it gives a massive core lint error, attached as `lint.log`.8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14159Decomposition of path sometimes fails2019-07-07T18:18:13ZTamar ChristinaDecomposition of path sometimes failsThe path decomposition sometimes fails in SysTools with an `INVALID_FUNCTION` error. The fall back method never executes because of the unexpected raised exception.
This makes the Windows tarballs a but unpredictable when placed in rand...The path decomposition sometimes fails in SysTools with an `INVALID_FUNCTION` error. The fall back method never executes because of the unexpected raised exception.
This makes the Windows tarballs a but unpredictable when placed in random folders and starting up from random cwd.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.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":"Decomposition of path sometimes fails","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.2.2","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The path decomposition sometimes fails in SysTools with an `INVALID_FUNCTION` error. The fall back method never executes because of the unexpected raised exception.\r\n\r\nThis makes the Windows tarballs a but unpredictable when placed in random folders and starting up from random cwd.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2Tamar ChristinaTamar Christinahttps://gitlab.haskell.org/ghc/ghc/-/issues/14158(Control.Category.id @(->) >>=) causes GHC panic2019-07-07T18:18:13ZIcelandjack(Control.Category.id @(->) >>=) causes GHC panic```
$ ghci -ignore-dot-ghci -XTypeApplications
GHCi, version 8.3.20170605: http://www.haskell.org/ghc/ :? for help
Prelude> import qualified Control.Category as Cat
Prelude Cat> :t (Cat.id @(->) >>=)
ghc: panic! (the 'impossible' happen...```
$ ghci -ignore-dot-ghci -XTypeApplications
GHCi, version 8.3.20170605: http://www.haskell.org/ghc/ :? for help
Prelude> import qualified Control.Category as Cat
Prelude Cat> :t (Cat.id @(->) >>=)
ghc: panic! (the 'impossible' happened)
(GHC version 8.3.20170605 for x86_64-unknown-linux):
repSplitAppTy_maybe
a0_a1qW[tau:2]
a0_a1qW[tau:2]
Call stack:
CallStack (from HasCallStack):
prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:699:5 in ghc:Type
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Prelude Cat>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.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":"(Control.Category.id @(->) >>=) causes GHC panic","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\n$ ghci -ignore-dot-ghci -XTypeApplications\r\nGHCi, version 8.3.20170605: http://www.haskell.org/ghc/ :? for help\r\nPrelude> import qualified Control.Category as Cat\r\nPrelude Cat> :t (Cat.id @(->) >>=)\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.3.20170605 for x86_64-unknown-linux):\r\n\trepSplitAppTy_maybe\r\n a0_a1qW[tau:2]\r\n a0_a1qW[tau:2]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable\r\n callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Type.hs:699:5 in ghc:Type\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\nPrelude Cat> \r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.2.2https://gitlab.haskell.org/ghc/ghc/-/issues/14154Some cocktail of features causes GHC panic2019-07-07T18:18:14ZIcelandjackSome cocktail of features causes GHC panic```hs
{-# Language RankNTypes, DerivingStrategies, TypeApplications,
ScopedTypeVariables, GADTs, PolyKinds #-}
module T14154 where
newtype Ran g h a
= MkRan (forall b. (a -> g b) -> h b)
newtype Swap p f g a where
MkSwap :: p ...```hs
{-# Language RankNTypes, DerivingStrategies, TypeApplications,
ScopedTypeVariables, GADTs, PolyKinds #-}
module T14154 where
newtype Ran g h a
= MkRan (forall b. (a -> g b) -> h b)
newtype Swap p f g a where
MkSwap :: p g f a -> Swap p f g a
ireturn :: forall m i a. a -> m i i a
ireturn = undefined
xs = case ireturn @(Swap Ran) 'a' of
MkSwap (MkRan f) -> f print
```
```
$ ghci -ignore-dot-ghci /tmp/bug.hs
GHCi, version 8.3.20170605: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( /tmp/bug.hs, interpreted )
ghc: panic! (the 'impossible' happened)
(GHC version 8.3.20170605 for x86_64-unknown-linux):
piResultTy
k0_a1Ki[tau:2]
b0_a1Kt[tau:2]
Call stack:
CallStack (from HasCallStack):
prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:949:35 in ghc:Type
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
```8.2.2