GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-11-03T20:24:50Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/16990ghc-8.8.1 RC1 build no longer detects llc-7.02019-11-03T20:24:50ZJens Petersenghc-8.8.1 RC1 build no longer detects llc-7.0## Summary
Due to 71aca77c, llvm7.0 is no longer detected on Fedora.
I think a change was needed since Debian llvm-7 now ships `/usr/bin/llc-7` (compared to Fedora still providing `/usr/bin/llc-7.0`).
The problem is after the above fix I...## Summary
Due to 71aca77c, llvm7.0 is no longer detected on Fedora.
I think a change was needed since Debian llvm-7 now ships `/usr/bin/llc-7` (compared to Fedora still providing `/usr/bin/llc-7.0`).
The problem is after the above fix I think Debian now detects it's llc-7 correctly but now ghc needs to be patched to detect llc-7.0 on Fedora at least.
BTW It might be better to use `Data.Version` for `LlvmVersion`? Then it would be easy to `read` "7" or "7.0" etc (some distro or system could even have bindir/llc-7.1 or bindir/llc-7.0.1, etc).
(I kind of miss the old `--with-llc` (and `--with-opt`) configure options here - were they so bad? :slight_smile:)
## Steps to reproduce
Try to configure ghc-8.8.1 RC1 on Fedora ARM (32 or 64 bit) with llvm7.0
## Expected behavior
llc-7.0 and opt-7.0 to be detected like for the alpha releases.
## Actual behavior
llvm not detected.
## Environment
* GHC version used: 8.4.4
Optional:
* Operating System: Fedora
* System Architecture: armv7hl/aarch64
ps I worked around this for now with:
https://src.fedoraproject.org/rpms/ghc/blob/694ee07680e4618076b71efa4cc5279984c73e43/f/ghc-8.8-configure-llvm-7.0.patch
but we should really detect both llc-7 and llc-7.0 out of the box in my opinion.
I filed a [Fedora RFE](https://bugzilla.redhat.com/show_bug.cgi?id=1733421) asking if our llvm7.0 package can provide llc-7 and opt-7 symlinks but there may be other distros shipping llc-7.0. Hopefully in the future Fedora llvm8 package would provide llc-8...8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16968Packaging error: GHC 8.8.1-rc1 doesn't contain any source code2019-08-10T10:37:08Zofrytim4job@bmail.ruPackaging error: GHC 8.8.1-rc1 doesn't contain any source code## Summary
GHC 8.8.1-rc1 doesn't contain any source code
## Steps to reproduce
https://downloads.haskell.org/ghc/8.8.1-rc1/ghc-8.8.0.20190721-src.tar.xz doesn't contain any source.
## Expected behavior
There should be source code.
...## Summary
GHC 8.8.1-rc1 doesn't contain any source code
## Steps to reproduce
https://downloads.haskell.org/ghc/8.8.1-rc1/ghc-8.8.0.20190721-src.tar.xz doesn't contain any source.
## Expected behavior
There should be source code.
## Environment
* GHC version used: 8.8.1-rc1
Optional:
* Operating System:
* System Architecture:8.8.1Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/16690Update 8.8 libraries2019-07-20T02:56:47ZOleg GrenrusUpdate 8.8 librariesIn current 8.8 tip 334dd6da47326f47ba3425376728feda6245c7c1, these libraries don't point to a release tag (or old release):
- `binary`: currently at 0.8.6.0 + commits
- `bytestring` 13 commits since 0.10.8.2
- `containers` 10 commits sin...In current 8.8 tip 334dd6da47326f47ba3425376728feda6245c7c1, these libraries don't point to a release tag (or old release):
- `binary`: currently at 0.8.6.0 + commits
- `bytestring` 13 commits since 0.10.8.2
- `containers` 10 commits since 0.6.0.1
- `deepseq` 1 commit since 1.4.4.0
- `directory` 1 commit since 1.3.3.2
- `haskeline` 1 commit since 0.7.5.0
- `parallel`4 commits since 3.2.2.0
- `parsec` 6 commits since 3.1.13.0
- `process` 5 commits since 1.6.5.0
- `stm` 4 commits since 2.5.0.0
- `terminfo` points to commit which looks like `0.4.1.4` but isn't the actual tagged commit. https://github.com/judah/terminfo/issues/34
- `text` 4 commits since 1.2.3.1
- `time` is at 1.9.2, but there is 1.9.3
- `unix` 5 commits since 2.7.2.2
- And as a bonus `Cabal`, which is partly tracked by https://gitlab.haskell.org/ghc/ghc/issues/16637
IMHO it would be clearer if each boot library had a PATCH release, so `git submodule foreach git describe --always` would tell which versions are there. Currently some of the packages have some not-essential `.travis.yml` churn; some have a little of metadata change (e.g. relaxed base, time etc bounds), or actual unreleased changes (e.g. binary and text at least).
---
From https://gitlab.haskell.org/ghc/ghc/issues/16602
> In general, actionable things like bumping Cabal should have a ticket otherwise they are destined to fall through the cracks. It looks like in this case I failed to open one and no one else did so either.8.8.1Ben GamariHerbert Valerio Riedelhvr@gnu.orgBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/16652Can't build `ghc-8.8` branch with `happy-1.19.10`2020-08-12T16:14:05ZRyan ScottCan't build `ghc-8.8` branch with `happy-1.19.10`Building the `ghc-8.8` branch (commit c56dad0132275841f92a02b79da7d3612ef85025) with `happy-1.19.10` results in the following error:
```
$ make -j1
===--- building phase 0
make --no-print-directory -f ghc.mk phase=0 phase_0_builds
make[...Building the `ghc-8.8` branch (commit c56dad0132275841f92a02b79da7d3612ef85025) with `happy-1.19.10` results in the following error:
```
$ make -j1
===--- building phase 0
make --no-print-directory -f ghc.mk phase=0 phase_0_builds
make[1]: Nothing to be done for 'phase_0_builds'.
===--- building phase 1
make --no-print-directory -f ghc.mk phase=1 phase_1_builds
"/opt/ghc/8.6.5/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -package-db libraries/bootstrapping.conf -this-unit-id ghc-8.8.0.20190426 -hide-all-packages -i -icompiler/backpack -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/hieFile -icompiler/stage1/build -Icompiler/stage1/build -icompiler/stage1/build/./autogen -Icompiler/stage1/build/./autogen -Icompiler/. -Icompiler/parser -Icompiler/utils -Icompiler/stage1 -Icompiler/stage1/build/. -Icompiler/stage1/build/parser -Icompiler/stage1/build/utils -Icompiler/stage1/build/stage1 -optP-include -optPcompiler/stage1/build/./autogen/cabal_macros.h -package-id array-0.5.3.0 -package-id base-4.12.0.0 -package-id binary-0.8.6.0 -package-id bytestring-0.10.8.2 -package-id containers-0.6.0.1 -package-id deepseq-1.4.4.0 -package-id directory-1.3.3.0 -package-id filepath-1.4.2.1 -package-id ghc-boot-8.8.0.20190426 -package-id ghc-boot-th-8.8.0.20190426 -package-id ghc-heap-8.8.0.20190426 -package-id ghci-8.8.0.20190426 -package-id hpc-0.6.0.3 -package-id process-1.6.5.0 -package-id template-haskell-2.15.0.0 -package-id terminfo-0.4.1.3 -package-id time-1.8.0.2 -package-id transformers-0.5.6.2 -package-id unix-2.7.2.2 -Wall -Wno-name-shadowing -Wnoncanonical-monad-instances -Wnoncanonical-monoid-instances -this-unit-id ghc -XHaskell2010 -XNoImplicitPrelude -DSTAGE=1 -Rghc-timing -O -Wcpp-undef -no-user-package-db -rtsopts -O0 -fno-ignore-interface-pragmas -fcmm-sink -outputdir compiler/stage1/build -c compiler/stage1/build/Parser.hs -o compiler/stage1/build/Parser.o
compiler/stage1/build/Parser.hs:1487:48: error:
Not in scope: type variable ‘a’
|
1487 | newtype HappyWrap211 = HappyWrap211 (([Located a],Bool))
| ^
<<ghc: 1566236888 bytes, 272 GCs, 22676065/72601344 avg/max bytes residency (8 samples), 152M in use, 0.000 INIT (0.000 elapsed), 0.549 MUT (0.560 elapsed), 0.464 GC (0.464 elapsed) :ghc>>
compiler/ghc.mk:444: recipe for target 'compiler/stage1/build/Parser.o' failed
make[1]: *** [compiler/stage1/build/Parser.o] Error 1
Makefile:123: recipe for target 'all' failed
make: *** [all] Error 2
```
The use of `make` here is inconsequential, as the same error also occurs with Hadrian.
cc @int\-index8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16608Recompilation results in linking failure or program segfault2019-09-02T11:30:45ZKirill Elaginkirelagin@gmail.comRecompilation results in linking failure or program segfault# Summary
I have a small program (one `newtype`, one `class`, one `instance`) that seems to mess with recompilation.
If I make a minor change to the source and recompile, linking will fail. However, adding a little _more_ code (namely, ...# Summary
I have a small program (one `newtype`, one `class`, one `instance`) that seems to mess with recompilation.
If I make a minor change to the source and recompile, linking will fail. However, adding a little _more_ code (namely, a composition with `id`) results in successful compilation, but SIGSEGV in runtime, when a certain thunk is evaluated. It is worth noting, that `-O1` makes the issue go away.
```
(lldb) target create "./Main2"
Current executable set to './Main2' (x86_64).
(lldb) r
Process 22932 launched: './Main2' (x86_64)
Process 22932 stopped
* thread #1, name = 'Main2', stop reason = signal SIGSEGV: invalid address (fault address: 0x4b20)
frame #0: 0x0000000000487a38 Main2`stg_IND_STATIC_info + 8
Main2`stg_IND_STATIC_info:
-> 0x487a38 <+8>: jmpq *(%rbx)
0x487a3a: nopw (%rax,%rax)
0x487a40: addl %eax, (%rax)
0x487a42: addb %al, (%rax)
(lldb) register read
General Purpose Registers:
rax = 0x0000000000000001
rbx = 0x0000000000004b20
rcx = 0x0000000000000012
rdx = 0x00000042001ff070
rdi = 0x0000004200106179
rsi = 0x00000000004b2081 MyInteger_zdfToMyIntegerInteger_closure + 1
rbp = 0x00000042001052b8
rsp = 0x00007fffffff79a8
r8 = 0x0000004200104198
r9 = 0x0000000000000000
r10 = 0x0000004200104e00
r11 = 0x0000004200104e40
r12 = 0x00000042001061a0
r13 = 0x00000000004bd218 Main2`MainCapability + 24
r14 = 0x0000004200106179
r15 = 0x00000042001050c0
rip = 0x0000000000487a38 Main2`stg_IND_STATIC_info + 8
rflags = 0x0000000000010202
cs = 0x0000000000000033
fs = 0x0000000000000000
gs = 0x0000000000000000
ss = 0x000000000000002b
ds = 0x0000000000000000
es = 0x0000000000000000
```
# Steps to reproduce
https://github.com/serokell/weird-ghc
* `git clone https://github.com/serokell/weird-ghc && cd weird-ghc`
* `./bug.sh 1` or `./bug.sh 2`
# Environment
* GHC version used: 8.2.2, 8.4.4, 8.6.4, `c9756dbf1e` (2018-12-18), `b1662e812c` (2019-01-29)8.8.1Ömer Sinan AğacanÖmer Sinan Ağacanhttps://gitlab.haskell.org/ghc/ghc/-/issues/16603GHC 8.8-related changelogs omit several important major developments2020-02-25T01:14:07ZRyan ScottGHC 8.8-related changelogs omit several important major developmentsWhile looking at the various changelogs associated with GHC 8.8, I noticed several key omissions:
# `libraries/base/changelog.md`
* [x] The `4.13.0.0` entry makes no mention of `MonadFail` whatsoever.
# `docs/users_guide/8.8.1-notes....While looking at the various changelogs associated with GHC 8.8, I noticed several key omissions:
# `libraries/base/changelog.md`
* [x] The `4.13.0.0` entry makes no mention of `MonadFail` whatsoever.
# `docs/users_guide/8.8.1-notes.rst`
No mention of any of the following:
* [x] Visible kind application
* [x] More explicit `forall`s in type family equations and `RULES`
* [x] The `base` section also does not mention `MonadFail`. Ideally, it would also point to https://gitlab.haskell.org/ghc/ghc/wikis/proposal/monad-fail#adapting-old-code
* [x] The Template Haskell section makes no mention of visible kind applications nor more explicit `forall`s.8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16586KnownNat: result changes depending on optimizations2022-09-29T15:25:07ZBodigrimKnownNat: result changes depending on optimizations# Summary
The following program changes output from `1` (without optimizations) to `331` (with `-O1`).
# Steps to reproduce
```haskell
{-# LANGUAGE DataKinds, PolyKinds, RankNTypes, ScopedTypeVariables #-}
module Main where
import D...# Summary
The following program changes output from `1` (without optimizations) to `331` (with `-O1`).
# Steps to reproduce
```haskell
{-# LANGUAGE DataKinds, PolyKinds, RankNTypes, ScopedTypeVariables #-}
module Main where
import Data.Proxy
import GHC.TypeNats
import Numeric.Natural
newtype Foo (m :: Nat) = Foo { getVal :: Word }
mul :: KnownNat m => Foo m -> Foo m -> Foo m
mul mx@(Foo x) (Foo y) =
Foo $ x * y `rem` fromIntegral (natVal mx)
pow :: KnownNat m => Foo m -> Int -> Foo m
pow x k = iterate (`mul` x) (Foo 1) !! k
modl :: (forall m. KnownNat m => Foo m) -> Natural -> Word
modl x m = case someNatVal m of
SomeNat (_ :: Proxy m) -> getVal (x :: Foo m)
main :: IO ()
main = print $ (Foo 127 `pow` 31336) `modl` 31337
dummyValue :: Word
dummyValue = (Foo 33 `pow` 44) `modl` 456
```
```
$ ghc -fforce-recomp Mod.hs && ./Mod
1
$ ghc -fforce-recomp -O Mod.hs && ./Mod
313
```
# Expected behavior
The [expected output](https://www.wolframalpha.com/input/?i=127+%5E+31336+mod+31337) is `1`.
While `dummyValue` is absolutely unused and should not have any impact, compilation with `-O` somehow replaces `31337` in `main` with `456`, producing [313](https://www.wolframalpha.com/input/?i=127+%5E+31336+mod+456). This can be also verified by dumping Core: it does not even contain `31337` anywhere, but surprisingly includes `456`.
Any of the following restores the behaviour of `-O1` program to expected:
* Remove `module Main where` line.
* Switch from `GHC.TypeNats` to `GHC.TypeLits`.
* Change ``(`mul` x)`` to `(mul x)`.
# Environment
* GHC version used: 8.6.4
* Operating System: macOS 10.14.4
* System Architecture: x648.8.1Iavor S. DiatchkiIavor S. Diatchkihttps://gitlab.haskell.org/ghc/ghc/-/issues/16527GHCi 8.8+ parenthesizes GADT fields incorrectly with :info2020-02-25T01:14:32ZRyan ScottGHCi 8.8+ parenthesizes GADT fields incorrectly with :infoLoad the following code into GHCi using 8.8 or later:
```hs
{-# LANGUAGE GADTs #-}
module Bug where
data T where
MkT :: (Int -> Int) -> T
```
And then try `:info T`:
```
λ> :info T
data T where
MkT :: Int -> Int -> T
-- D...Load the following code into GHCi using 8.8 or later:
```hs
{-# LANGUAGE GADTs #-}
module Bug where
data T where
MkT :: (Int -> Int) -> T
```
And then try `:info T`:
```
λ> :info T
data T where
MkT :: Int -> Int -> T
-- Defined at Bug.hs:4:1
```
Eek! Those parentheses around `Int -> Int` are required, but aren't showing up here.
This is my fault, as I accidentally introduced this regression in commit 9d9e35574a92773d872efd58a67339a9e054a9f1. When pretty-printing fields in a GADT type signature, I should have been using `funPrec`, not `topPrec`, since the fields are interspersed with arrows. Unfortunately, no regression tests existed to catch my mistake.
Patch incoming.8.8.1Ryan ScottRyan Scotthttps://gitlab.haskell.org/ghc/ghc/-/issues/16517GHC 8.8 (or later)-only panic (metaTyVarRef)2019-07-07T18:00:09ZRyan ScottGHC 8.8 (or later)-only panic (metaTyVarRef)The following code panics on GHC 8.8 or later:
```haskell
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
module Bug where
import Data.Proxy
class C f where
m :: f (p :: Proxy a)
```
```
$ ~/Software/ghc5/inplace/bin/ghc-stage...The following code panics on GHC 8.8 or later:
```haskell
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
module Bug where
import Data.Proxy
class C f where
m :: f (p :: Proxy a)
```
```
$ ~/Software/ghc5/inplace/bin/ghc-stage2 Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.9.20190330 for x86_64-unknown-linux):
metaTyVarRef
f_avi
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1169:37 in ghc:Outputable
pprPanic, called at compiler/typecheck/TcType.hs:1215:14 in ghc:TcType
```
On GHC 8.6.4, this simply produces an error message:
```
$ /opt/ghc/8.6.4/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:8:8: error:
• Expected kind ‘Proxy a -> *’, but ‘f’ has kind ‘k0’
• In the type signature: m :: f (p :: Proxy a)
In the class declaration for ‘C’
|
8 | m :: f (p :: Proxy a)
| ^^^^^^^^^^^^^^^^
```8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16490base's changelog is incorrect for 4.13.0.02019-07-07T18:00:10ZRyan Scottbase's changelog is incorrect for 4.13.0.0`base-4.13.0.0` (which will be bundled with GHC 8.8) features a change to `Fixed`'s `Show` instance (see !41). However, `base`'s changelog incorrectly claims that this change will debut in `4.12.0.0`, not `4.13.0.0`.`base-4.13.0.0` (which will be bundled with GHC 8.8) features a change to `Fixed`'s `Show` instance (see !41). However, `base`'s changelog incorrectly claims that this change will debut in `4.12.0.0`, not `4.13.0.0`.8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16449GHC 8.8 heap overflow regression2020-02-25T01:14:48ZRyan ScottGHC 8.8 heap overflow regressionThe following program throws a heap overflow if you compile it with optimization on GHC 8.8 and HEAD:
```haskell
module Bug where
import Data.Bits (setBit)
f :: Int
f = foldl setter 0 $ zip [0..] [()]
where
setter v (ix, _) = se...The following program throws a heap overflow if you compile it with optimization on GHC 8.8 and HEAD:
```haskell
module Bug where
import Data.Bits (setBit)
f :: Int
f = foldl setter 0 $ zip [0..] [()]
where
setter v (ix, _) = setBit v ix
```
```
$ ~/Software/ghc3/inplace/bin/ghc-stage2 -fforce-recomp -O Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.9.20190309 for x86_64-unknown-linux):
heap overflow
```
This does not happen with GHC 8.6.4.
The `FontyFruity` package on Hackage fails to build on GHC HEAD due to this regression.8.8.1Ömer Sinan AğacanÖmer Sinan Ağacanhttps://gitlab.haskell.org/ghc/ghc/-/issues/16398Missing documentation in Windows bindist tarball2019-09-12T22:55:30ZBen GamariMissing documentation in Windows bindist tarballTakenobu noticed the following omissions from the 8.6.4 bindist tarball:
> Perhaps you may know, but the following html documents are not included in
> the windows tarball \[1\]:
>
> - doc/html/index.html
> - doc/html/users_guide/index....Takenobu noticed the following omissions from the 8.6.4 bindist tarball:
> Perhaps you may know, but the following html documents are not included in
> the windows tarball \[1\]:
>
> - doc/html/index.html
> - doc/html/users_guide/index.html
> - doc/html/libraries/index.html
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------- |
| Version | 8.6.4 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Documentation |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Missing documentation in Windows bindist tarball","status":"New","operating_system":"","component":"Documentation","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.4","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Takenobu noticed the following omissions from the 8.6.4 bindist tarball:\r\n\r\n> Perhaps you may know, but the following html documents are not included in\r\n> the windows tarball [1]:\r\n>\r\n> * doc/html/index.html\r\n> * doc/html/users_guide/index.html\r\n> * doc/html/libraries/index.html\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/16378bkpcabal01 fails with recent Cabal2019-07-07T18:00:19ZBen Gamaribkpcabal01 fails with recent CabalAfter bumping `Cabal` on the `ghc-8.8` branch `bkpcabal01` fails:
```
=====> bkpcabal01(normal) 85 of 6807 [0, 0, 0]
cd "backpack/cabal/bkpcabal01/bkpcabal01.run" && $MAKE -s --no-print-directory bkpcabal01 CLEANUP=1
Wrong exit code f...After bumping `Cabal` on the `ghc-8.8` branch `bkpcabal01` fails:
```
=====> bkpcabal01(normal) 85 of 6807 [0, 0, 0]
cd "backpack/cabal/bkpcabal01/bkpcabal01.run" && $MAKE -s --no-print-directory bkpcabal01 CLEANUP=1
Wrong exit code for bkpcabal01()(expected 0 , actual 2 )
Stdout ( bkpcabal01 ):
Makefile:9: recipe for target 'bkpcabal01' failed
Stderr ( bkpcabal01 ):
Error:
The following packages are broken because other packages they depend on are missing. These broken packages must be rebuilt before they can be used.
planned package bkpcabal01-0.1.0.0 is broken due to missing package p-0.1+FBOSaiWyMx9DR2UZVI6wQJ
```
Anyone know what is going on here?
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | ezyang, hvr |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"bkpcabal01 fails with recent Cabal","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["ezyang","hvr"],"type":"Bug","description":"After bumping `Cabal` on the `ghc-8.8` branch `bkpcabal01` fails:\r\n{{{\r\n=====> bkpcabal01(normal) 85 of 6807 [0, 0, 0]\r\ncd \"backpack/cabal/bkpcabal01/bkpcabal01.run\" && $MAKE -s --no-print-directory bkpcabal01 CLEANUP=1 \r\nWrong exit code for bkpcabal01()(expected 0 , actual 2 )\r\nStdout ( bkpcabal01 ):\r\nMakefile:9: recipe for target 'bkpcabal01' failed\r\nStderr ( bkpcabal01 ):\r\nError:\r\n The following packages are broken because other packages they depend on are missing. These broken packages must be rebuilt before they can be used.\r\nplanned package bkpcabal01-0.1.0.0 is broken due to missing package p-0.1+FBOSaiWyMx9DR2UZVI6wQJ\r\n\r\n}}}\r\n\r\nAnyone know what is going on here?","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16331REGRESSION: --supported-languages lies about supported languages, again2024-01-09T16:22:59ZHerbert Valerio Riedelhvr@gnu.orgREGRESSION: --supported-languages lies about supported languages, againTo make it short, recent version of GHC broke the very thing we fixed in #11102 for GHC 8.0. This is utterly frustrating to me. ;-(
Basically, if GHC advertises an extension, it's supposed to work without jumping through hoops if you en...To make it short, recent version of GHC broke the very thing we fixed in #11102 for GHC 8.0. This is utterly frustrating to me. ;-(
Basically, if GHC advertises an extension, it's supposed to work without jumping through hoops if you enable it via `{-# LANGUAGE ... #-}` or `-X`-flags. Otherwise this breaks the whole idea of `other-extensions` and related cabal spec features which use `--supported-languages` to infer whether e.g. GHC when invoked with `-XTemplateHaskell` will succeed.
However, consider the `Main.hs` below
```hs
{-# LANGUAGE TemplateHaskell #-}
main = $undefined
```
Unfortuantely now GHC lies unconditionally about supporting TH, thereby undermining the infrastructure we setup in and for #11102:
```
$ ghc --supported-languages | grep ^TemplateHaskell$
TemplateHaskell
$ ghc --make Foo.hs
[1 of 1] Compiling Main ( Foo.hs, Foo.o )
ghc-stage2: this operation requires -fexternal-interpreter
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"REGRESSION: --supported-languages lies about supported languages, again","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"To make it short, recent version of GHC broke the very thing we fixed in #11102 for GHC 8.0. This is utterly frustrating to me. ;-(\r\n\r\n\r\nBasically, if GHC advertises an extension, it's supposed to work without jumping through hoops if you enable it via `{-# LANGUAGE ... #-}` or `-X`-flags. Otherwise this breaks the whole idea of `other-extensions` and related cabal spec features which use `--supported-languages` to infer whether e.g. GHC when invoked with `-XTemplateHaskell` will succeed.\r\n\r\nHowever, consider the `Main.hs` below\r\n\r\n{{{#!hs\r\n{-# LANGUAGE TemplateHaskell #-}\r\n\r\nmain = $undefined\r\n}}}\r\n\r\nUnfortuantely now GHC lies unconditionally about supporting TH, thereby undermining the infrastructure we setup in and for #11102:\r\n\r\n{{{\r\n$ ghc --supported-languages | grep ^TemplateHaskell$\r\nTemplateHaskell\r\n\r\n$ ghc --make Foo.hs \r\n[1 of 1] Compiling Main ( Foo.hs, Foo.o )\r\nghc-stage2: this operation requires -fexternal-interpreter\r\n}}}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Alp MestanogullariAlp Mestanogullarihttps://gitlab.haskell.org/ghc/ghc/-/issues/16225GHC HEAD-only Core Lint error (Trans coercion mis-match)2019-07-07T18:00:54ZRyan ScottGHC HEAD-only Core Lint error (Trans coercion mis-match)The following code compiles on GHC 8.0.2 through GHC 8.6.3 with `-dcore-lint`:
```hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
mo...The following code compiles on GHC 8.0.2 through GHC 8.6.3 with `-dcore-lint`:
```hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
data family Sing :: k -> Type
data TyFun :: Type -> Type -> Type
type a ~> b = TyFun a b -> Type
infixr 0 ~>
type family Apply (f :: a ~> b) (x :: a) :: b
data TyCon1 :: (k1 -> k2) -> (k1 ~> k2)
type instance Apply (TyCon1 f) x = f x
data SomeApply :: (k ~> Type) -> Type where
SomeApply :: Apply f a -> SomeApply f
f :: SomeApply (TyCon1 Sing :: k ~> Type)
-> SomeApply (TyCon1 Sing :: k ~> Type)
f (SomeApply s)
= SomeApply s
```
However, it chokes on GHC HEAD:
```
$ ~/Software/ghc4/inplace/bin/ghc-stage2 --interactive Bug.hs -dcore-lint
GHCi, version 8.7.20190120: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
[1 of 1] Compiling Bug ( Bug.hs, interpreted )
*** Core Lint errors : in result of Desugar (before optimization) ***
<no location info>: warning:
In the expression: SomeApply
@ k_a1Dz
@ (TyCon1 Sing)
@ Any
(s_a1Bq
`cast` (Sub (D:R:ApplyabTyCon1x[0]
<k_a1Dz>_N
<*>_N
<Sing>_N
<a_a1DB>_N ; Sym (D:R:ApplyabTyCon1x[0]
<k_a1Dz>_N <*>_N <Sing>_N <Any>_N))
:: Apply (TyCon1 Sing) a_a1DB ~R# Apply (TyCon1 Sing) Any))
Trans coercion mis-match: D:R:ApplyabTyCon1x[0]
<k_a1Dz>_N <*>_N <Sing>_N <a_a1DB>_N ; Sym (D:R:ApplyabTyCon1x[0]
<k_a1Dz>_N
<*>_N
<Sing>_N
<Any>_N)
Apply (TyCon1 Sing) a_a1DB
Sing a_a1DB
Sing Any
Apply (TyCon1 Sing) Any
*** Offending Program ***
<elided>
f :: forall k. SomeApply (TyCon1 Sing) -> SomeApply (TyCon1 Sing)
[LclIdX]
f = \ (@ k_a1Dz) (ds_d1EV :: SomeApply (TyCon1 Sing)) ->
case ds_d1EV of wild_00 { SomeApply @ a_a1DB s_a1Bq ->
break<0>(s_a1Bq)
SomeApply
@ k_a1Dz
@ (TyCon1 Sing)
@ Any
(s_a1Bq
`cast` (Sub (D:R:ApplyabTyCon1x[0]
<k_a1Dz>_N <*>_N <Sing>_N <a_a1DB>_N ; Sym (D:R:ApplyabTyCon1x[0]
<k_a1Dz>_N
<*>_N
<Sing>_N
<Any>_N))
:: Apply (TyCon1 Sing) a_a1DB ~R# Apply (TyCon1 Sing) Any))
}
```
Note that if I change the definition of `Sing` to this:
```hs
data family Sing (a :: k)
```
Then the error goes away.
Also, if I extend `SomeProxy` with an additional `proxy` field:
```hs
data SomeApply :: (k ~> Type) -> Type where
SomeApply :: proxy a -> Apply f a -> SomeApply f
f :: SomeApply (TyCon1 Sing :: k ~> Type)
-> SomeApply (TyCon1 Sing :: k ~> Type)
f (SomeApply p s)
= SomeApply p s
```
Then the error also goes away. Perhaps `a` being ambiguous plays an important role here?
Possibly related to #16188 or #16204.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC HEAD-only Core Lint error (Trans coercion mis-match)","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following code compiles on GHC 8.0.2 through GHC 8.6.3 with `-dcore-lint`:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE AllowAmbiguousTypes #-}\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\n\r\ndata family Sing :: k -> Type\r\ndata TyFun :: Type -> Type -> Type\r\ntype a ~> b = TyFun a b -> Type\r\ninfixr 0 ~>\r\ntype family Apply (f :: a ~> b) (x :: a) :: b\r\n\r\ndata TyCon1 :: (k1 -> k2) -> (k1 ~> k2)\r\ntype instance Apply (TyCon1 f) x = f x\r\n\r\ndata SomeApply :: (k ~> Type) -> Type where\r\n SomeApply :: Apply f a -> SomeApply f\r\n\r\nf :: SomeApply (TyCon1 Sing :: k ~> Type)\r\n -> SomeApply (TyCon1 Sing :: k ~> Type)\r\nf (SomeApply s)\r\n = SomeApply s\r\n}}}\r\n\r\nHowever, it chokes on GHC HEAD:\r\n\r\n{{{\r\n$ ~/Software/ghc4/inplace/bin/ghc-stage2 --interactive Bug.hs -dcore-lint\r\nGHCi, version 8.7.20190120: https://www.haskell.org/ghc/ :? for help\r\nLoaded GHCi configuration from /home/rgscott/.ghci\r\n[1 of 1] Compiling Bug ( Bug.hs, interpreted )\r\n*** Core Lint errors : in result of Desugar (before optimization) ***\r\n<no location info>: warning:\r\n In the expression: SomeApply\r\n @ k_a1Dz\r\n @ (TyCon1 Sing)\r\n @ Any\r\n (s_a1Bq\r\n `cast` (Sub (D:R:ApplyabTyCon1x[0]\r\n <k_a1Dz>_N\r\n <*>_N\r\n <Sing>_N\r\n <a_a1DB>_N ; Sym (D:R:ApplyabTyCon1x[0]\r\n <k_a1Dz>_N <*>_N <Sing>_N <Any>_N))\r\n :: Apply (TyCon1 Sing) a_a1DB ~R# Apply (TyCon1 Sing) Any))\r\n Trans coercion mis-match: D:R:ApplyabTyCon1x[0]\r\n <k_a1Dz>_N <*>_N <Sing>_N <a_a1DB>_N ; Sym (D:R:ApplyabTyCon1x[0]\r\n <k_a1Dz>_N\r\n <*>_N\r\n <Sing>_N\r\n <Any>_N)\r\n Apply (TyCon1 Sing) a_a1DB\r\n Sing a_a1DB\r\n Sing Any\r\n Apply (TyCon1 Sing) Any\r\n*** Offending Program ***\r\n\r\n<elided>\r\n\r\nf :: forall k. SomeApply (TyCon1 Sing) -> SomeApply (TyCon1 Sing)\r\n[LclIdX]\r\nf = \\ (@ k_a1Dz) (ds_d1EV :: SomeApply (TyCon1 Sing)) ->\r\n case ds_d1EV of wild_00 { SomeApply @ a_a1DB s_a1Bq ->\r\n break<0>(s_a1Bq)\r\n SomeApply\r\n @ k_a1Dz\r\n @ (TyCon1 Sing)\r\n @ Any\r\n (s_a1Bq\r\n `cast` (Sub (D:R:ApplyabTyCon1x[0]\r\n <k_a1Dz>_N <*>_N <Sing>_N <a_a1DB>_N ; Sym (D:R:ApplyabTyCon1x[0]\r\n <k_a1Dz>_N\r\n <*>_N\r\n <Sing>_N\r\n <Any>_N))\r\n :: Apply (TyCon1 Sing) a_a1DB ~R# Apply (TyCon1 Sing) Any))\r\n }\r\n}}}\r\n\r\nNote that if I change the definition of `Sing` to this:\r\n\r\n{{{#!hs\r\ndata family Sing (a :: k)\r\n}}}\r\n\r\nThen the error goes away.\r\n\r\nAlso, if I extend `SomeProxy` with an additional `proxy` field:\r\n\r\n{{{#!hs\r\ndata SomeApply :: (k ~> Type) -> Type where\r\n SomeApply :: proxy a -> Apply f a -> SomeApply f\r\n\r\nf :: SomeApply (TyCon1 Sing :: k ~> Type)\r\n -> SomeApply (TyCon1 Sing :: k ~> Type)\r\nf (SomeApply p s)\r\n = SomeApply p s\r\n}}}\r\n\r\nThen the error also goes away. Perhaps `a` being ambiguous plays an important role here?\r\n\r\nPossibly related to #16188 or #16204.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16218T16180 is broken on Darwin2019-07-07T18:00:55ZBen GamariT16180 is broken on DarwinUnfortunately the test `T16180` snuck in to the tree in with commit f035504b, just before I had a chance to merge !137, making Darwin a mandatory-green platform. Consequently we didn't catch that this test is broken on Darwin.
<details>...Unfortunately the test `T16180` snuck in to the tree in with commit f035504b, just before I had a chance to merge !137, making Darwin a mandatory-green platform. Consequently we didn't catch that this test is broken on Darwin.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"T16180 is broken on Darwin","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Unfortunately the test `T16180` snuck in to the tree in with commit f035504b, just before I had a chance to merge !137, making Darwin a mandatory-green platform. Consequently we didn't catch that this test is broken on Darwin.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16204GHC HEAD-only Core Lint error (Argument value doesn't match argument type)2019-07-07T18:00:58ZRyan ScottGHC HEAD-only Core Lint error (Argument value doesn't match argument type)The following program passes Core Lint on GHC 8.6.3:
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{...The following program passes Core Lint on GHC 8.6.3:
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
module Bug where
import Data.Kind
-----
-- singletons machinery
-----
data family Sing :: forall k. k -> Type
data SomeSing :: Type -> Type where
SomeSing :: Sing (a :: k) -> SomeSing k
-----
-- (Simplified) GHC.Generics
-----
class Generic (a :: Type) where
type Rep a :: Type
from :: a -> Rep a
to :: Rep a -> a
class PGeneric (a :: Type) where
-- type PFrom ...
type PTo (x :: Rep a) :: a
class SGeneric k where
-- sFrom :: ...
sTo :: forall (a :: Rep k). Sing a -> Sing (PTo a :: k)
-----
class SingKind k where
type Demote k :: Type
-- fromSing :: ...
toSing :: Demote k -> SomeSing k
genericToSing :: forall k.
( SingKind k, SGeneric k, SingKind (Rep k)
, Generic (Demote k), Rep (Demote k) ~ Demote (Rep k) )
=> Demote k -> SomeSing k
genericToSing d = withSomeSing @(Rep k) (from d) $ SomeSing . sTo
withSomeSing :: forall k r
. SingKind k
=> Demote k
-> (forall (a :: k). Sing a -> r)
-> r
withSomeSing x f =
case toSing x of
SomeSing x' -> f x'
```
But not on GHC HEAD:
```
$ ~/Software/ghc4/inplace/bin/ghc-stage2 Bug.hs -dcore-lint
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
*** Core Lint errors : in result of Desugar (before optimization) ***
<no location info>: warning:
In the expression: $ @ 'LiftedRep
@ (forall (a :: Rep k_a1cV). Sing a -> SomeSing k_a1cV)
@ (SomeSing k_a1cV)
(withSomeSing
@ (Rep k_a1cV)
@ (SomeSing k_a1cV)
$dSingKind_a1d5
((from
@ (Demote k_a1cV)
$dGeneric_a1d7
(d_aX7
`cast` (Sub co_a1dK
:: Demote k_a1cV[sk:1] ~R# Demote k_a1cV[sk:1])))
`cast` (Sub (Sym (Sym co_a1dR ; Sym co_a1dM) ; (Sym co_a1dQ ; (Demote
(Sym co_a1dO))_N))
:: Rep (Demote k_a1cV[sk:1]) ~R# Demote (Rep k_a1cV[sk:1]))))
(\ (@ (a_a1dc :: Rep k_a1cV)) ->
let {
$dSGeneric_a1dm :: SGeneric k_a1cV
[LclId]
$dSGeneric_a1dm = $dSGeneric_a1cY } in
. @ (Sing (PTo Any))
@ (SomeSing k_a1cV)
@ (Sing Any)
(SomeSing @ k_a1cV @ (PTo Any))
((sTo @ k_a1cV $dSGeneric_a1dm @ Any)
`cast` (Sym (Sing
(Sym co_a1dO) (Sym (GRefl nominal Any co_a1dO)))_R
->_R <Sing (PTo Any)>_R
:: (Sing Any -> Sing (PTo Any))
~R# (Sing Any -> Sing (PTo Any)))))
Argument value doesn't match argument type:
Fun type:
(forall (a :: Rep k_a1cV). Sing a -> SomeSing k_a1cV)
-> SomeSing k_a1cV
Arg type: forall (a :: Rep k_a1cV). Sing Any -> SomeSing k_a1cV
Arg:
\ (@ (a_a1dc :: Rep k_a1cV)) ->
let {
$dSGeneric_a1dm :: SGeneric k_a1cV
[LclId]
$dSGeneric_a1dm = $dSGeneric_a1cY } in
. @ (Sing (PTo Any))
@ (SomeSing k_a1cV)
@ (Sing Any)
(SomeSing @ k_a1cV @ (PTo Any))
((sTo @ k_a1cV $dSGeneric_a1dm @ Any)
`cast` (Sym (Sing
(Sym co_a1dO) (Sym (GRefl nominal Any co_a1dO)))_R
->_R <Sing (PTo Any)>_R
:: (Sing Any -> Sing (PTo Any)) ~R# (Sing Any -> Sing (PTo Any))))
*** Offending Program ***
<elided>
genericToSing
:: forall k.
(SingKind k, SGeneric k, SingKind (Rep k), Generic (Demote k),
Rep (Demote k) ~ Demote (Rep k)) =>
Demote k -> SomeSing k
[LclIdX]
genericToSing
= \ (@ k_a1cV)
($dSingKind_a1cX :: SingKind k_a1cV)
($dSGeneric_a1cY :: SGeneric k_a1cV)
($dSingKind_a1cZ :: SingKind (Rep k_a1cV))
($dGeneric_a1d0 :: Generic (Demote k_a1cV))
($d~_a1d1 :: Rep (Demote k_a1cV) ~ Demote (Rep k_a1cV)) ->
let {
co_a1dQ :: Demote (Rep k_a1cV) ~# Demote (Rep k_a1cV)
[LclId[CoVarId]]
co_a1dQ = CO: <Demote (Rep k_a1cV)>_N } in
let {
co_a1dO :: Rep k_a1cV ~# Rep k_a1cV
[LclId[CoVarId]]
co_a1dO = CO: <Rep k_a1cV>_N } in
let {
$dSingKind_a1dT :: SingKind (Rep k_a1cV)
[LclId]
$dSingKind_a1dT
= $dSingKind_a1cZ
`cast` (Sub (Sym (SingKind (Sym co_a1dO))_N)
:: SingKind (Rep k_a1cV[sk:1])
~R# SingKind (Rep k_a1cV[sk:1])) } in
let {
$dSingKind_a1d5 :: SingKind (Rep k_a1cV)
[LclId]
$dSingKind_a1d5
= $dSingKind_a1dT
`cast` ((SingKind (Sym co_a1dO))_R
:: SingKind (Rep k_a1cV[sk:1])
~R# SingKind (Rep k_a1cV[sk:1])) } in
let {
co_a1dM :: Rep (Demote k_a1cV) ~# Rep (Demote k_a1cV)
[LclId[CoVarId]]
co_a1dM = CO: <Rep (Demote k_a1cV)>_N } in
let {
co_a1dK :: Demote k_a1cV ~# Demote k_a1cV
[LclId[CoVarId]]
co_a1dK = CO: <Demote k_a1cV>_N } in
let {
$dGeneric_a1dU :: Generic (Demote k_a1cV)
[LclId]
$dGeneric_a1dU
= $dGeneric_a1d0
`cast` (Sub (Sym (Generic (Sym co_a1dK))_N)
:: Generic (Demote k_a1cV[sk:1])
~R# Generic (Demote k_a1cV[sk:1])) } in
let {
$dGeneric_a1d7 :: Generic (Demote k_a1cV)
[LclId]
$dGeneric_a1d7 = $dGeneric_a1dU } in
case eq_sel
@ * @ (Rep (Demote k_a1cV)) @ (Demote (Rep k_a1cV)) $d~_a1d1
of co_a1dI
{ __DEFAULT ->
let {
co_a1dR :: Rep (Demote k_a1cV) ~# Demote (Rep k_a1cV)
[LclId[CoVarId]]
co_a1dR
= CO: ((Sym co_a1dM ; (Rep
(Sym co_a1dK))_N) ; co_a1dI) ; Sym (Sym co_a1dQ ; (Demote
(Sym co_a1dO))_N) } in
\ (d_aX7 :: Demote k_a1cV) ->
$ @ 'LiftedRep
@ (forall (a :: Rep k_a1cV). Sing a -> SomeSing k_a1cV)
@ (SomeSing k_a1cV)
(withSomeSing
@ (Rep k_a1cV)
@ (SomeSing k_a1cV)
$dSingKind_a1d5
((from
@ (Demote k_a1cV)
$dGeneric_a1d7
(d_aX7
`cast` (Sub co_a1dK
:: Demote k_a1cV[sk:1] ~R# Demote k_a1cV[sk:1])))
`cast` (Sub (Sym (Sym co_a1dR ; Sym co_a1dM) ; (Sym co_a1dQ ; (Demote
(Sym co_a1dO))_N))
:: Rep (Demote k_a1cV[sk:1]) ~R# Demote (Rep k_a1cV[sk:1]))))
(\ (@ (a_a1dc :: Rep k_a1cV)) ->
let {
$dSGeneric_a1dm :: SGeneric k_a1cV
[LclId]
$dSGeneric_a1dm = $dSGeneric_a1cY } in
. @ (Sing (PTo Any))
@ (SomeSing k_a1cV)
@ (Sing Any)
(SomeSing @ k_a1cV @ (PTo Any))
((sTo @ k_a1cV $dSGeneric_a1dm @ Any)
`cast` (Sym (Sing
(Sym co_a1dO) (Sym (GRefl nominal Any co_a1dO)))_R
->_R <Sing (PTo Any)>_R
:: (Sing Any -> Sing (PTo Any)) ~R# (Sing Any -> Sing (PTo Any)))))
}
```
I'm not sure if this is related to #16188 (see #16188\##16204), but this Core Lint error is technically different from the one in that ticket, so I decided to open a new issue for this.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | #16188 |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC HEAD-only Core Lint error (Argument value doesn't match argument type)","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[16188],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program passes Core Lint on GHC 8.6.3:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE DataKinds #-}\r\n{-# LANGUAGE FlexibleContexts #-}\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE PolyKinds #-}\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeApplications #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\n\r\n-----\r\n-- singletons machinery\r\n-----\r\n\r\ndata family Sing :: forall k. k -> Type\r\ndata SomeSing :: Type -> Type where\r\n SomeSing :: Sing (a :: k) -> SomeSing k\r\n\r\n-----\r\n-- (Simplified) GHC.Generics\r\n-----\r\n\r\nclass Generic (a :: Type) where\r\n type Rep a :: Type\r\n from :: a -> Rep a\r\n to :: Rep a -> a\r\n\r\nclass PGeneric (a :: Type) where\r\n -- type PFrom ...\r\n type PTo (x :: Rep a) :: a\r\n\r\nclass SGeneric k where\r\n -- sFrom :: ...\r\n sTo :: forall (a :: Rep k). Sing a -> Sing (PTo a :: k)\r\n\r\n-----\r\n\r\nclass SingKind k where\r\n type Demote k :: Type\r\n -- fromSing :: ...\r\n toSing :: Demote k -> SomeSing k\r\n\r\ngenericToSing :: forall k.\r\n ( SingKind k, SGeneric k, SingKind (Rep k)\r\n , Generic (Demote k), Rep (Demote k) ~ Demote (Rep k) )\r\n => Demote k -> SomeSing k\r\ngenericToSing d = withSomeSing @(Rep k) (from d) $ SomeSing . sTo\r\n\r\nwithSomeSing :: forall k r\r\n . SingKind k\r\n => Demote k\r\n -> (forall (a :: k). Sing a -> r)\r\n -> r\r\nwithSomeSing x f =\r\n case toSing x of\r\n SomeSing x' -> f x'\r\n}}}\r\n\r\nBut not on GHC HEAD:\r\n\r\n{{{\r\n$ ~/Software/ghc4/inplace/bin/ghc-stage2 Bug.hs -dcore-lint \r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n*** Core Lint errors : in result of Desugar (before optimization) ***\r\n<no location info>: warning:\r\n In the expression: $ @ 'LiftedRep\r\n @ (forall (a :: Rep k_a1cV). Sing a -> SomeSing k_a1cV)\r\n @ (SomeSing k_a1cV)\r\n (withSomeSing\r\n @ (Rep k_a1cV)\r\n @ (SomeSing k_a1cV)\r\n $dSingKind_a1d5\r\n ((from\r\n @ (Demote k_a1cV)\r\n $dGeneric_a1d7\r\n (d_aX7\r\n `cast` (Sub co_a1dK\r\n :: Demote k_a1cV[sk:1] ~R# Demote k_a1cV[sk:1])))\r\n `cast` (Sub (Sym (Sym co_a1dR ; Sym co_a1dM) ; (Sym co_a1dQ ; (Demote\r\n (Sym co_a1dO))_N))\r\n :: Rep (Demote k_a1cV[sk:1]) ~R# Demote (Rep k_a1cV[sk:1]))))\r\n (\\ (@ (a_a1dc :: Rep k_a1cV)) ->\r\n let {\r\n $dSGeneric_a1dm :: SGeneric k_a1cV\r\n [LclId]\r\n $dSGeneric_a1dm = $dSGeneric_a1cY } in\r\n . @ (Sing (PTo Any))\r\n @ (SomeSing k_a1cV)\r\n @ (Sing Any)\r\n (SomeSing @ k_a1cV @ (PTo Any))\r\n ((sTo @ k_a1cV $dSGeneric_a1dm @ Any)\r\n `cast` (Sym (Sing\r\n (Sym co_a1dO) (Sym (GRefl nominal Any co_a1dO)))_R\r\n ->_R <Sing (PTo Any)>_R\r\n :: (Sing Any -> Sing (PTo Any))\r\n ~R# (Sing Any -> Sing (PTo Any)))))\r\n Argument value doesn't match argument type:\r\n Fun type:\r\n (forall (a :: Rep k_a1cV). Sing a -> SomeSing k_a1cV)\r\n -> SomeSing k_a1cV\r\n Arg type: forall (a :: Rep k_a1cV). Sing Any -> SomeSing k_a1cV\r\n Arg:\r\n \\ (@ (a_a1dc :: Rep k_a1cV)) ->\r\n let {\r\n $dSGeneric_a1dm :: SGeneric k_a1cV\r\n [LclId]\r\n $dSGeneric_a1dm = $dSGeneric_a1cY } in\r\n . @ (Sing (PTo Any))\r\n @ (SomeSing k_a1cV)\r\n @ (Sing Any)\r\n (SomeSing @ k_a1cV @ (PTo Any))\r\n ((sTo @ k_a1cV $dSGeneric_a1dm @ Any)\r\n `cast` (Sym (Sing\r\n (Sym co_a1dO) (Sym (GRefl nominal Any co_a1dO)))_R\r\n ->_R <Sing (PTo Any)>_R\r\n :: (Sing Any -> Sing (PTo Any)) ~R# (Sing Any -> Sing (PTo Any))))\r\n*** Offending Program ***\r\n<elided>\r\ngenericToSing\r\n :: forall k.\r\n (SingKind k, SGeneric k, SingKind (Rep k), Generic (Demote k),\r\n Rep (Demote k) ~ Demote (Rep k)) =>\r\n Demote k -> SomeSing k\r\n[LclIdX]\r\ngenericToSing\r\n = \\ (@ k_a1cV)\r\n ($dSingKind_a1cX :: SingKind k_a1cV)\r\n ($dSGeneric_a1cY :: SGeneric k_a1cV)\r\n ($dSingKind_a1cZ :: SingKind (Rep k_a1cV))\r\n ($dGeneric_a1d0 :: Generic (Demote k_a1cV))\r\n ($d~_a1d1 :: Rep (Demote k_a1cV) ~ Demote (Rep k_a1cV)) ->\r\n let {\r\n co_a1dQ :: Demote (Rep k_a1cV) ~# Demote (Rep k_a1cV)\r\n [LclId[CoVarId]]\r\n co_a1dQ = CO: <Demote (Rep k_a1cV)>_N } in\r\n let {\r\n co_a1dO :: Rep k_a1cV ~# Rep k_a1cV\r\n [LclId[CoVarId]]\r\n co_a1dO = CO: <Rep k_a1cV>_N } in\r\n let {\r\n $dSingKind_a1dT :: SingKind (Rep k_a1cV)\r\n [LclId]\r\n $dSingKind_a1dT\r\n = $dSingKind_a1cZ\r\n `cast` (Sub (Sym (SingKind (Sym co_a1dO))_N)\r\n :: SingKind (Rep k_a1cV[sk:1])\r\n ~R# SingKind (Rep k_a1cV[sk:1])) } in\r\n let {\r\n $dSingKind_a1d5 :: SingKind (Rep k_a1cV)\r\n [LclId]\r\n $dSingKind_a1d5\r\n = $dSingKind_a1dT\r\n `cast` ((SingKind (Sym co_a1dO))_R\r\n :: SingKind (Rep k_a1cV[sk:1])\r\n ~R# SingKind (Rep k_a1cV[sk:1])) } in\r\n let {\r\n co_a1dM :: Rep (Demote k_a1cV) ~# Rep (Demote k_a1cV)\r\n [LclId[CoVarId]]\r\n co_a1dM = CO: <Rep (Demote k_a1cV)>_N } in\r\n let {\r\n co_a1dK :: Demote k_a1cV ~# Demote k_a1cV\r\n [LclId[CoVarId]]\r\n co_a1dK = CO: <Demote k_a1cV>_N } in\r\n let {\r\n $dGeneric_a1dU :: Generic (Demote k_a1cV)\r\n [LclId]\r\n $dGeneric_a1dU\r\n = $dGeneric_a1d0\r\n `cast` (Sub (Sym (Generic (Sym co_a1dK))_N)\r\n :: Generic (Demote k_a1cV[sk:1])\r\n ~R# Generic (Demote k_a1cV[sk:1])) } in\r\n let {\r\n $dGeneric_a1d7 :: Generic (Demote k_a1cV)\r\n [LclId]\r\n $dGeneric_a1d7 = $dGeneric_a1dU } in\r\n case eq_sel\r\n @ * @ (Rep (Demote k_a1cV)) @ (Demote (Rep k_a1cV)) $d~_a1d1\r\n of co_a1dI\r\n { __DEFAULT ->\r\n let {\r\n co_a1dR :: Rep (Demote k_a1cV) ~# Demote (Rep k_a1cV)\r\n [LclId[CoVarId]]\r\n co_a1dR\r\n = CO: ((Sym co_a1dM ; (Rep\r\n (Sym co_a1dK))_N) ; co_a1dI) ; Sym (Sym co_a1dQ ; (Demote\r\n (Sym co_a1dO))_N) } in\r\n \\ (d_aX7 :: Demote k_a1cV) ->\r\n $ @ 'LiftedRep\r\n @ (forall (a :: Rep k_a1cV). Sing a -> SomeSing k_a1cV)\r\n @ (SomeSing k_a1cV)\r\n (withSomeSing\r\n @ (Rep k_a1cV)\r\n @ (SomeSing k_a1cV)\r\n $dSingKind_a1d5\r\n ((from\r\n @ (Demote k_a1cV)\r\n $dGeneric_a1d7\r\n (d_aX7\r\n `cast` (Sub co_a1dK\r\n :: Demote k_a1cV[sk:1] ~R# Demote k_a1cV[sk:1])))\r\n `cast` (Sub (Sym (Sym co_a1dR ; Sym co_a1dM) ; (Sym co_a1dQ ; (Demote\r\n (Sym co_a1dO))_N))\r\n :: Rep (Demote k_a1cV[sk:1]) ~R# Demote (Rep k_a1cV[sk:1]))))\r\n (\\ (@ (a_a1dc :: Rep k_a1cV)) ->\r\n let {\r\n $dSGeneric_a1dm :: SGeneric k_a1cV\r\n [LclId]\r\n $dSGeneric_a1dm = $dSGeneric_a1cY } in\r\n . @ (Sing (PTo Any))\r\n @ (SomeSing k_a1cV)\r\n @ (Sing Any)\r\n (SomeSing @ k_a1cV @ (PTo Any))\r\n ((sTo @ k_a1cV $dSGeneric_a1dm @ Any)\r\n `cast` (Sym (Sing\r\n (Sym co_a1dO) (Sym (GRefl nominal Any co_a1dO)))_R\r\n ->_R <Sing (PTo Any)>_R\r\n :: (Sing Any -> Sing (PTo Any)) ~R# (Sing Any -> Sing (PTo Any)))))\r\n }\r\n}}}\r\n\r\nI'm not sure if this is related to #16188 (see https://ghc.haskell.org/trac/ghc/ticket/16188#comment:1), but this Core Lint error is technically different from the one in that ticket, so I decided to open a new issue for this.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16188GHC HEAD-only panic (buildKindCoercion)2019-07-07T18:01:01ZRyan ScottGHC HEAD-only panic (buildKindCoercion)The following program compiles without issue on GHC 8.6.3:
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ...The following program compiles without issue on GHC 8.6.3:
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module Bug where
import Data.Kind (Type)
import Data.Type.Bool (type (&&))
data TyFun :: Type -> Type -> Type
type a ~> b = TyFun a b -> Type
infixr 0 ~>
type family Apply (f :: a ~> b) (x :: a) :: b
data family Sing :: forall k. k -> Type
data instance Sing :: Bool -> Type where
SFalse :: Sing False
STrue :: Sing True
(%&&) :: forall (x :: Bool) (y :: Bool).
Sing x -> Sing y -> Sing (x && y)
SFalse %&& _ = SFalse
STrue %&& a = a
data RegExp :: Type -> Type where
App :: RegExp t -> RegExp t -> RegExp t
data instance Sing :: forall t. RegExp t -> Type where
SApp :: Sing re1 -> Sing re2 -> Sing (App re1 re2)
data ReNotEmptySym0 :: forall t. RegExp t ~> Bool
type instance Apply ReNotEmptySym0 r = ReNotEmpty r
type family ReNotEmpty (r :: RegExp t) :: Bool where
ReNotEmpty (App re1 re2) = ReNotEmpty re1 && ReNotEmpty re2
sReNotEmpty :: forall t (r :: RegExp t).
Sing r -> Sing (Apply ReNotEmptySym0 r :: Bool)
sReNotEmpty (SApp sre1 sre2) = sReNotEmpty sre1 %&& sReNotEmpty sre2
blah :: forall (t :: Type) (re :: RegExp t).
Sing re -> ()
blah (SApp sre1 sre2)
= case (sReNotEmpty sre1, sReNotEmpty sre2) of
(STrue, STrue) -> ()
```
However, it panics on GHC HEAD:
```
$ ~/Software/ghc4/inplace/bin/ghc-stage2 Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20190114 for x86_64-unknown-linux):
buildKindCoercion
Any
ReNotEmpty re2_a1hm
Bool
t_a1hg
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1159:37 in ghc:Outputable
pprPanic, called at compiler/types/Coercion.hs:2427:9 in ghc:Coercion
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC HEAD-only panic (buildKindCoercion)","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program compiles without issue on GHC 8.6.3:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE DataKinds #-}\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE PolyKinds #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeOperators #-}\r\n{-# LANGUAGE UndecidableInstances #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind (Type)\r\nimport Data.Type.Bool (type (&&))\r\n\r\ndata TyFun :: Type -> Type -> Type\r\ntype a ~> b = TyFun a b -> Type\r\ninfixr 0 ~>\r\ntype family Apply (f :: a ~> b) (x :: a) :: b\r\ndata family Sing :: forall k. k -> Type\r\n\r\ndata instance Sing :: Bool -> Type where\r\n SFalse :: Sing False\r\n STrue :: Sing True\r\n\r\n(%&&) :: forall (x :: Bool) (y :: Bool).\r\n Sing x -> Sing y -> Sing (x && y)\r\nSFalse %&& _ = SFalse\r\nSTrue %&& a = a\r\n\r\ndata RegExp :: Type -> Type where\r\n App :: RegExp t -> RegExp t -> RegExp t\r\n\r\ndata instance Sing :: forall t. RegExp t -> Type where\r\n SApp :: Sing re1 -> Sing re2 -> Sing (App re1 re2)\r\n\r\ndata ReNotEmptySym0 :: forall t. RegExp t ~> Bool\r\ntype instance Apply ReNotEmptySym0 r = ReNotEmpty r\r\n\r\ntype family ReNotEmpty (r :: RegExp t) :: Bool where\r\n ReNotEmpty (App re1 re2) = ReNotEmpty re1 && ReNotEmpty re2\r\n\r\nsReNotEmpty :: forall t (r :: RegExp t).\r\n Sing r -> Sing (Apply ReNotEmptySym0 r :: Bool)\r\nsReNotEmpty (SApp sre1 sre2) = sReNotEmpty sre1 %&& sReNotEmpty sre2\r\n\r\nblah :: forall (t :: Type) (re :: RegExp t).\r\n Sing re -> ()\r\nblah (SApp sre1 sre2)\r\n = case (sReNotEmpty sre1, sReNotEmpty sre2) of\r\n (STrue, STrue) -> ()\r\n}}}\r\n\r\nHowever, it panics on GHC HEAD:\r\n\r\n{{{\r\n$ ~/Software/ghc4/inplace/bin/ghc-stage2 Bug.hs \r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.7.20190114 for x86_64-unknown-linux):\r\n buildKindCoercion\r\n Any\r\n ReNotEmpty re2_a1hm\r\n Bool\r\n t_a1hg\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1159:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Coercion.hs:2427:9 in ghc:Coercion\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Richard Eisenbergrae@richarde.devRichard Eisenbergrae@richarde.devhttps://gitlab.haskell.org/ghc/ghc/-/issues/16141StrictData and TypeFamilies regression2019-07-14T10:09:05ZRyan ScottStrictData and TypeFamilies regressionThe credit goes to wuzzeb for originally discovering this bug [here](https://www.reddit.com/r/haskell/comments/ad9a7k/strictdata_typefamilies_and_ghc_86/). I've minimized their test case slightly below:
```hs
{-# LANGUAGE StrictData #-}...The credit goes to wuzzeb for originally discovering this bug [here](https://www.reddit.com/r/haskell/comments/ad9a7k/strictdata_typefamilies_and_ghc_86/). I've minimized their test case slightly below:
```hs
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
module Bug where
data family T
newtype instance T = MkT Int deriving Eq
```
With optimization enabled, this program compiles with GHC 8.0.2 through 8.4.4, but not with 8.6.3 or HEAD:
```
$ /opt/ghc/8.4.4/bin/ghc -fforce-recomp -O Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
$ /opt/ghc/8.6.3/bin/ghc -fforce-recomp -O Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:6:39: error:
• Couldn't match a lifted type with an unlifted type
arising from the coercion of the method ‘==’
from type ‘GHC.Prim.Int# -> GHC.Prim.Int# -> Bool’
to type ‘T -> T -> Bool’
• When deriving the instance for (Eq T)
|
6 | newtype instance T = MkT Int deriving Eq
| ^^
```
Based on the error message, it appears as if GHC mistakenly believes that the representation type of the `T` instance is `Int#`, rather than `Int`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"StrictData and TypeFamilies regression","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The credit goes to wuzzeb for originally discovering this bug [https://www.reddit.com/r/haskell/comments/ad9a7k/strictdata_typefamilies_and_ghc_86/ here]. I've minimized their test case slightly below:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE StrictData #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\nmodule Bug where\r\n\r\ndata family T\r\nnewtype instance T = MkT Int deriving Eq\r\n}}}\r\n\r\nWith optimization enabled, this program compiles with GHC 8.0.2 through 8.4.4, but not with 8.6.3 or HEAD:\r\n\r\n{{{\r\n$ /opt/ghc/8.4.4/bin/ghc -fforce-recomp -O Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\n$ /opt/ghc/8.6.3/bin/ghc -fforce-recomp -O Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:6:39: error:\r\n • Couldn't match a lifted type with an unlifted type\r\n arising from the coercion of the method ‘==’\r\n from type ‘GHC.Prim.Int# -> GHC.Prim.Int# -> Bool’\r\n to type ‘T -> T -> Bool’\r\n • When deriving the instance for (Eq T)\r\n |\r\n6 | newtype instance T = MkT Int deriving Eq\r\n | ^^\r\n}}}\r\n\r\nBased on the error message, it appears as if GHC mistakenly believes that the representation type of the `T` instance is `Int#`, rather than `Int`.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16066internal error: PAP object entered!2020-02-25T01:15:51Zdnspiesinternal error: PAP object entered!While trying to debug why my test didn't seem to be running, I got an internal error (below).
After a clean and rebuild it happened again so it's not a flake. Unfortunately I don't know what's causing it so I can't produce an MWE, but I...While trying to debug why my test didn't seem to be running, I got an internal error (below).
After a clean and rebuild it happened again so it's not a flake. Unfortunately I don't know what's causing it so I can't produce an MWE, but I can link to the project and commit on GitHub:
https://github.com/dspies-leapyear/persistwrap/tree/885a079923cb3eefb24db344f5e2fddee9fab425
Just run the test with:
```
stack test persistwrap:persistwrap-test
```
```
Progress 9/10: persistwrap-0.1.0.0test/Driver.hs
test_widget_schemas: persistwrap-test: internal error: PAP object entered!
(GHC version 8.4.4 for x86_64_apple_darwin)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
persistwrap-test: SignalException 6
persistwrap-0.1.0.0: Test suite persistwrap-test failed
Completed 10 action(s).
Test suite failure for package persistwrap-0.1.0.0
persistwrap-test: exited with: ExitFailure (-6)
Logs printed to console
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.4 |
| 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":"internal error: PAP object entered!","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.4","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"While trying to debug why my test didn't seem to be running, I got an internal error (below).\r\n\r\nAfter a clean and rebuild it happened again so it's not a flake. Unfortunately I don't know what's causing it so I can't produce an MWE, but I can link to the project and commit on GitHub:\r\n\r\nhttps://github.com/dspies-leapyear/persistwrap/tree/885a079923cb3eefb24db344f5e2fddee9fab425\r\n\r\nJust run the test with:\r\n\r\n{{{\r\nstack test persistwrap:persistwrap-test\r\n}}}\r\n\r\n{{{\r\nProgress 9/10: persistwrap-0.1.0.0test/Driver.hs\r\n test_widget_schemas: persistwrap-test: internal error: PAP object entered!\r\n (GHC version 8.4.4 for x86_64_apple_darwin)\r\n Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\npersistwrap-test: SignalException 6\r\n\r\npersistwrap-0.1.0.0: Test suite persistwrap-test failed\r\nCompleted 10 action(s).\r\nTest suite failure for package persistwrap-0.1.0.0\r\n persistwrap-test: exited with: ExitFailure (-6)\r\nLogs printed to console\r\n}}}\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Ömer Sinan AğacanÖmer Sinan Ağacan