GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-09-12T22:55:30Zhttps://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/16394GHC internal error while typechecking of instance definition2019-07-07T18:00:15ZDay1721GHC internal error while typechecking of instance definitionHello. \\\\
This code won't typecheck because of GHC internal error.
```hs
{-# LANGUAGE PolyKinds, TypeFamilies, DataKinds #-}
class C a where
type T (n :: a)
-- v--DIFF--v
instance C a => C b => C (a, b) where
type T '(...Hello. \\\\
This code won't typecheck because of GHC internal error.
```hs
{-# LANGUAGE PolyKinds, TypeFamilies, DataKinds #-}
class C a where
type T (n :: a)
-- v--DIFF--v
instance C a => C b => C (a, b) where
type T '(n, m) = (T n, T m)
```
with error message:
```
Bug.hs:7:10: error:
• GHC internal error: ‘T’ is not in scope during type checking, but it passed the renamer
tcl_env of environment: [a1LS :-> Type variable ‘a’ = a :: *,
a1LT :-> Type variable ‘b’ = b :: *]
• In the type instance declaration for ‘T’
In the instance declaration for ‘C b => C (a, b)’
|
7 | type T (n, m) = (T n, T m)
| ^
Failed, no modules loaded.
```
but this works fine:
```hs
{-# LANGUAGE PolyKinds, TypeFamilies, DataKinds #-}
class C a where
type T (n :: a)
-- v--DIFF--v
instance (C a, C b) => C (a, b) where
type T '(n, m) = (T n, T m)
```
Not sure is a bug, but either way it would be better to make more understandable error message
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | low |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC internal error while typechecking of instance definition","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Hello. \\\\\r\nThis code won't typecheck because of GHC internal error.\r\n\r\n{{{#!hs\r\n{-# LANGUAGE PolyKinds, TypeFamilies, DataKinds #-}\r\n\r\nclass C a where\r\n type T (n :: a)\r\n\r\n-- v--DIFF--v\r\ninstance C a => C b => C (a, b) where\r\n type T '(n, m) = (T n, T m)\r\n}}}\r\n\r\nwith error message: \r\n{{{\r\nBug.hs:7:10: error:\r\n • GHC internal error: ‘T’ is not in scope during type checking, but it passed the renamer\r\n tcl_env of environment: [a1LS :-> Type variable ‘a’ = a :: *,\r\n a1LT :-> Type variable ‘b’ = b :: *]\r\n • In the type instance declaration for ‘T’\r\n In the instance declaration for ‘C b => C (a, b)’\r\n |\r\n7 | type T (n, m) = (T n, T m)\r\n | ^\r\nFailed, no modules loaded.\r\n\r\n}}}\r\n\r\nbut this works fine:\r\n{{{#!hs\r\n{-# LANGUAGE PolyKinds, TypeFamilies, DataKinds #-}\r\n\r\nclass C a where\r\n type T (n :: a)\r\n\r\n-- v--DIFF--v\r\ninstance (C a, C b) => C (a, b) where\r\n type T '(n, m) = (T n, T m)\r\n}}}\r\n\r\nNot sure is a bug, but either way it would be better to make more understandable error message","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://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/16339Cannot put (.) or (!) type operators into an export list2019-07-07T18:00:27ZRyan ScottCannot put (.) or (!) type operators into an export listThanks to recent work in GHC HEAD, it is now possible to define type operators named `(.)` and `(!)`:
```hs
type (f . g) x = f (g x)
type x ! f = f x
```
However, I was surprised to discover that it's not possible to put them in an exp...Thanks to recent work in GHC HEAD, it is now possible to define type operators named `(.)` and `(!)`:
```hs
type (f . g) x = f (g x)
type x ! f = f x
```
However, I was surprised to discover that it's not possible to put them in an export list! That is to say, this program doesn't parse:
```
{-# LANGUAGE TypeOperators #-}
module Bug (type (.), type (!)) where
type (f . g) x = f (g x)
type x ! f = f x
```
```
$ ~/Software/ghc4/inplace/bin/ghc-stage2 --interactive Bug.hs
GHCi, version 8.7.20190219: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
Bug.hs:2:19: error: parse error on input ‘.’
|
2 | module Bug (type (.), type (!)) where
| ^
```
This problem appears to be specific to the `(.)` and `(!)` type operators, since any other type operator will work in its place:
```hs
{-# LANGUAGE TypeOperators #-}
module Works (type (&)) where
type (f & g) x = f (g x)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Parser) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | int-index |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Cannot put (.) or (!) into an export list","status":"New","operating_system":"","component":"Compiler (Parser)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["int-index"],"type":"Bug","description":"Thanks to recent work in GHC HEAD, it is now possible to define type operators named `(.)` and `(!)`:\r\n\r\n{{{#!hs\r\ntype (f . g) x = f (g x)\r\ntype x ! f = f x\r\n}}}\r\n\r\nHowever, I was surprised to discover that it's not possible to put them in an export list! That is to say, this program doesn't parse:\r\n\r\n{{{\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug (type (.), type (!)) where\r\n\r\ntype (f . g) x = f (g x)\r\ntype x ! f = f x\r\n}}}\r\n{{{\r\n$ ~/Software/ghc4/inplace/bin/ghc-stage2 --interactive Bug.hs\r\nGHCi, version 8.7.20190219: https://www.haskell.org/ghc/ :? for help\r\nLoaded GHCi configuration from /home/rgscott/.ghci\r\n\r\nBug.hs:2:19: error: parse error on input ‘.’\r\n |\r\n2 | module Bug (type (.), type (!)) where\r\n | ^\r\n}}}\r\n\r\nThis problem appears to be specific to the `(.)` and `(!)` type operators, since any other type operator will work in its place:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Works (type (&)) where\r\n\r\ntype (f & g) x = f (g x)\r\n}}}","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/16311Suggest -XExistentialQuantification for 'forall' in data declarations2019-07-07T18:00:34ZVladislav ZavialovSuggest -XExistentialQuantification for 'forall' in data declarations[D5180](https://phabricator.haskell.org/D5180) introduced a slight regression to the error messages. In this code
```hs
data T = forall a. MkT a
```
GHC used to complain
```
rnfail053.hs:5:10:
Not a data constructor: ‘forall’
...[D5180](https://phabricator.haskell.org/D5180) introduced a slight regression to the error messages. In this code
```hs
data T = forall a. MkT a
```
GHC used to complain
```
rnfail053.hs:5:10:
Not a data constructor: ‘forall’
Perhaps you intended to use ExistentialQuantification
```
but then the message has become
```
rnfail053.hs:5:18: error:
Illegal symbol '.' in type
Perhaps you intended to use RankNTypes or a similar language
extension to enable explicit-forall syntax: forall <tvs>. <type>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.6.3 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Parser) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Suggest -XExistentialQuantification for 'forall' in data declarations","status":"New","operating_system":"","component":"Compiler (Parser)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"Phab:D5180 introduced a slight regression to the error messages. In this code\r\n\r\n{{{#!hs\r\ndata T = forall a. MkT a\r\n}}}\r\n\r\nGHC used to complain\r\n\r\n{{{\r\nrnfail053.hs:5:10:\r\n Not a data constructor: ‘forall’\r\n Perhaps you intended to use ExistentialQuantification\r\n}}}\r\n\r\nbut then the message has become\r\n\r\n{{{\r\nrnfail053.hs:5:18: error:\r\n Illegal symbol '.' in type\r\n Perhaps you intended to use RankNTypes or a similar language\r\n extension to enable explicit-forall syntax: forall <tvs>. <type>\r\n}}}\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16309Flag to instruct GHC not to use an environment file2019-07-07T18:00:35ZRichard Eisenbergrae@richarde.devFlag to instruct GHC not to use an environment fileAs the [user manual](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/packages.html#package-environments) documents, GHC looks for environment files in the current directory to tell it what packages to look for. There seem...As the [user manual](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/packages.html#package-environments) documents, GHC looks for environment files in the current directory to tell it what packages to look for. There seems to be no way to disable this behavior (short of deleting or renaming the environment file). This causes trouble for me, as I expect `ghci` to mean the same thing no matter where I say it.
Can we add a flag (perhaps `-no-package-env`) that tells GHC not to look for an environment file? Note that specifying a dummy package environment file doesn't work because we can't suppress the implicit `-hide-all-packages` that is triggered whenever using a package environment.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.6.3 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Flag to instruct GHC not to use an environment file","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"FeatureRequest","description":"As the [https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/packages.html#package-environments user manual] document, GHC looks for environment files in the current directory to tell it what packages to look for. There seems to be no way to disable this behavior (short of deleting or renaming the environment file). This causes trouble for me, as I expect `ghci` to mean the same thing no matter where I say it.\r\n\r\nCan we add a flag (perhaps `-no-package-env`) that tells GHC not to look for an environment file? Note that specifying a dummy package environment file doesn't work because we can't suppress the implicit `-hide-all-packages` that is triggered whenever using a package environment.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16303checkStack sanity check fails2019-07-07T18:00:36ZÖmer Sinan AğacancheckStack sanity check failscheckStackChunk() currently has a commented-out assertion:
```
void
checkStackChunk( StgPtr sp, StgPtr stack_end )
{
StgPtr p;
p = sp;
while (p < stack_end) {
p += checkStackFrame( p );
}
// ASSERT( p == sta...checkStackChunk() currently has a commented-out assertion:
```
void
checkStackChunk( StgPtr sp, StgPtr stack_end )
{
StgPtr p;
p = sp;
while (p < stack_end) {
p += checkStackFrame( p );
}
// ASSERT( p == stack_end ); -- HWL
}
```
I realized a while ago that if I enable it, it fails in some cases, so I asked
Simon Marlow about this. Quoting:
> I don't know, but blame says it was disabled by Hans-Wolfgang Loidl as part of
> the GUM merge 18 years ago. I suggest just enabling it and debug whatever goes
> wrong.
This ticket is to enable the assertion and fix bugs.
To reproduce, run the test suite:
```
$ make EXTRA_HC_OPTS='-debug -rtsopts' WAY=sanity
```
Tests that trigger the assertion:
- annrun01
- T10508_api
- dynCompileExpr
Tried with GHC HEAD
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | |
| 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":"checkStack sanity check fails","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"checkStackChunk() currently has a commented-out assertion:\r\n\r\n{{{\r\nvoid\r\ncheckStackChunk( StgPtr sp, StgPtr stack_end )\r\n{\r\n StgPtr p;\r\n\r\n p = sp;\r\n while (p < stack_end) {\r\n p += checkStackFrame( p );\r\n }\r\n // ASSERT( p == stack_end ); -- HWL\r\n}\r\n}}}\r\n\r\nI realized a while ago that if I enable it, it fails in some cases, so I asked\r\nSimon Marlow about this. Quoting:\r\n\r\n> I don't know, but blame says it was disabled by Hans-Wolfgang Loidl as part of\r\n> the GUM merge 18 years ago. I suggest just enabling it and debug whatever goes\r\n> wrong.\r\n\r\nThis ticket is to enable the assertion and fix bugs.\r\n\r\nTo reproduce, run the test suite:\r\n\r\n{{{\r\n$ make EXTRA_HC_OPTS='-debug -rtsopts' WAY=sanity\r\n}}}\r\n\r\nTests that trigger the assertion:\r\n\r\n- annrun01\r\n- T10508_api\r\n- dynCompileExpr\r\n\r\nTried with GHC HEAD","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16287:kind accepts bogus type2019-07-07T18:00:40ZSimon Peyton Jones:kind accepts bogus typeConsider this (current HEAD)
```
ghci> type family F :: k
ghci> data T :: (forall k. k) -> Type
ghci> :kind T F
T F :: *
```
This is bogus. `F` has arity 1, and cannot appear unsaturated.
<details><summary>Trac metadata</summary>
| T...Consider this (current HEAD)
```
ghci> type family F :: k
ghci> data T :: (forall k. k) -> Type
ghci> :kind T F
T F :: *
```
This is bogus. `F` has arity 1, and cannot appear unsaturated.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.3 |
| 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":":kind accepts bogus type","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":"Consider this (current HEAD)\r\n{{{\r\nghci> type family F :: k\r\nghci> data T :: (forall k. k) -> Type\r\nghci> :kind T F\r\nT F :: *\r\n}}}\r\nThis is bogus. `F` has arity 1, and cannot appear unsaturated.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16279Lexer: Alternate Layout Rule injects actual not virtual braces2019-07-07T18:00:42ZAlan ZimmermanLexer: Alternate Layout Rule injects actual not virtual bracesWhen the alternate layout rule is activated via a pragma, it injects tokens for `{` and `}` to make sure that the source is parsed properly.
But it injects `ITocurly` and `ITccurly`, rather than their virtual counterparts `ITvocurly` an...When the alternate layout rule is activated via a pragma, it injects tokens for `{` and `}` to make sure that the source is parsed properly.
But it injects `ITocurly` and `ITccurly`, rather than their virtual counterparts `ITvocurly` and `ITvccurly`.
This causes problems for `ghc-exactprint`, which tries to print these.
Test case (the existing T13087.hs)
```hs
{-# LANGUAGE AlternativeLayoutRule #-}
{-# LANGUAGE LambdaCase #-}
isOne :: Int -> Bool
isOne = \case 1 -> True
_ -> False
main = return ()
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Parser) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Lexer: Alternate Layout Rule injects actual not virtual braces","status":"New","operating_system":"","component":"Compiler (Parser)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"When the alternate layout rule is activated via a pragma, it injects tokens for `{` and `}` to make sure that the source is parsed properly.\r\n\r\nBut it injects `ITocurly` and `ITccurly`, rather than their virtual counterparts `ITvocurly` and `ITvccurly`.\r\n\r\nThis causes problems for `ghc-exactprint`, which tries to print these.\r\n\r\nTest case (the existing T13087.hs)\r\n \r\n{{{#!hs\r\n{-# LANGUAGE AlternativeLayoutRule #-}\r\n{-# LANGUAGE LambdaCase #-}\r\n\r\nisOne :: Int -> Bool\r\nisOne = \\case 1 -> True\r\n _ -> False\r\n\r\nmain = return ()\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Alan ZimmermanAlan Zimmermanhttps://gitlab.haskell.org/ghc/ghc/-/issues/16265API Annotations: parens anns discarded for `(*)` operator2019-07-07T18:00:45ZAlan ZimmermanAPI Annotations: parens anns discarded for `(*)` operatorThe patch from https://phabricator.haskell.org/D4865 introduces
```hs
go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix
= do { warnStarBndr l
; let name = mkOccName tcClsName (if isUni then "★" else "*")
...The patch from https://phabricator.haskell.org/D4865 introduces
```hs
go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix
= do { warnStarBndr l
; let name = mkOccName tcClsName (if isUni then "★" else "*")
; return (cL l (Unqual name), acc, fix, ann) }
```
which discards the parens annotations belonging to the `HsParTy`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Parser) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"API Annotations: parens anns discarded for `(*)` operator","status":"New","operating_system":"","component":"Compiler (Parser)","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The patch from https://phabricator.haskell.org/D4865 introduces\r\n\r\n{{{#!hs\r\n go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix\r\n = do { warnStarBndr l\r\n ; let name = mkOccName tcClsName (if isUni then \"★\" else \"*\")\r\n ; return (cL l (Unqual name), acc, fix, ann) }\r\n}}}\r\n\r\nwhich discards the parens annotations belonging to the `HsParTy`.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Alan ZimmermanAlan Zimmermanhttps://gitlab.haskell.org/ghc/ghc/-/issues/16260Use of plugins causes different SafeHaskellMode returned for the module2019-07-07T18:00:46ZZejun WuUse of plugins causes different SafeHaskellMode returned for the moduleUse of plugins will mark safe inference as failed, even when the plugin does not modify anything. This can result in compile error when -XSafe is used. For example:
```
$ cat DefaultPlugin.hs
module DefaultPlugin (plugin) where
import G...Use of plugins will mark safe inference as failed, even when the plugin does not modify anything. This can result in compile error when -XSafe is used. For example:
```
$ cat DefaultPlugin.hs
module DefaultPlugin (plugin) where
import GhcPlugins
plugin = defaultPlugin
$ cat B.hs
{-# OPTIONS_GHC -fplugin DefaultPlugin #-}
module B (answer) where
answer = 42
$ cat A.hs
{-# LANGUAGE Safe #-}
module A (main) where
import B
main = print answer
$ ...
A.hs:4:1: error:
B: Can't be safely imported! The module itself isn't safe.
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Use of plugins causes -XSafe to fail","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Use of plugins will mark safe inference as failed, even when the plugin does not modify anything. This can result in compile error when -XSafe is used. For example:\r\n\r\n{{{\r\n$ cat DefaultPlugin.hs\r\nmodule DefaultPlugin (plugin) where\r\nimport GhcPlugins\r\nplugin = defaultPlugin\r\n\r\n$ cat B.hs\r\n{-# OPTIONS_GHC -fplugin DefaultPlugin #-}\r\nmodule B (answer) where\r\nanswer = 42\r\n\r\n$ cat A.hs\r\n{-# LANGUAGE Safe #-}\r\nmodule A (main) where\r\nimport B\r\nmain = print answer\r\n\r\n$ ...\r\nA.hs:4:1: error:\r\n B: Can't be safely imported! The module itself isn't safe.\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Zejun WuZejun Wuhttps://gitlab.haskell.org/ghc/ghc/-/issues/16255Visible kind application defeats type family with higher-rank result kind2019-07-07T18:00:47ZRyan ScottVisible kind application defeats type family with higher-rank result kindAfter #15740, GHC now (correctly) rejects this program:
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
module Bug where
import Dat...After #15740, GHC now (correctly) rejects this program:
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
module Bug where
import Data.Kind
data SBool :: Bool -> Type
type family F :: forall k. k -> Type where
F = SBool
```
```
$ ~/Software/ghc5/inplace/bin/ghc-stage2 --interactive Bug.hs
GHCi, version 8.7.20190115: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
[1 of 1] Compiling Bug ( Bug.hs, interpreted )
Bug.hs:12:7: error:
• Expected kind ‘forall k. k -> *’,
but ‘SBool’ has kind ‘Bool -> *’
• In the type ‘SBool’
In the type family declaration for ‘F’
|
12 | F = SBool
| ^^^^^
```
However, there's a very simple way to circumvent this: add a visible kind application to `F`'s equation.
```hs
type family F :: forall k. k -> Type where
F @Bool = SBool
```
If I understand things correctly, GHC shouldn't allow this.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Visible kind application defeats type family with higher-rank result kind","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":["TypeApplications,","TypeFamilies"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"After #15740, GHC now (correctly) rejects this program:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE DataKinds #-}\r\n{-# LANGUAGE PolyKinds #-}\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE TypeApplications #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\n\r\ndata SBool :: Bool -> Type\r\ntype family F :: forall k. k -> Type where\r\n F = SBool\r\n}}}\r\n{{{\r\n$ ~/Software/ghc5/inplace/bin/ghc-stage2 --interactive Bug.hs\r\nGHCi, version 8.7.20190115: 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\r\nBug.hs:12:7: error:\r\n • Expected kind ‘forall k. k -> *’,\r\n but ‘SBool’ has kind ‘Bool -> *’\r\n • In the type ‘SBool’\r\n In the type family declaration for ‘F’\r\n |\r\n12 | F = SBool\r\n | ^^^^^\r\n}}}\r\n\r\nHowever, there's a very simple way to circumvent this: add a visible kind application to `F`'s equation.\r\n\r\n{{{#!hs\r\ntype family F :: forall k. k -> Type where\r\n F @Bool = SBool\r\n}}}\r\n\r\nIf I understand things correctly, GHC shouldn't allow this.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16236API Annotations: AnnAt disconnected for TYPEAPP2019-07-07T18:00:51ZAlan ZimmermanAPI Annotations: AnnAt disconnected for TYPEAPPFor the code
```hs
type family F1 (a :: k) (f :: k -> Type) :: Type where
F1 @Peano a f = T @Peano f a
```
the API annotation for the first `@` is not attached to a `SourcSpan` in the `ParsedSource`
<details><summary>Trac metadata</...For the code
```hs
type family F1 (a :: k) (f :: k -> Type) :: Type where
F1 @Peano a f = T @Peano f a
```
the API annotation for the first `@` is not attached to a `SourcSpan` in the `ParsedSource`
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Parser) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"API Annotations: AnnAt disconnected for TYPEAPP","status":"New","operating_system":"","component":"Compiler (Parser)","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"For the code\r\n\r\n{{{#!hs\r\ntype family F1 (a :: k) (f :: k -> Type) :: Type where\r\n F1 @Peano a f = T @Peano f a\r\n}}}\r\n\r\nthe API annotation for the first `@` is not attached to a `SourcSpan` in the `ParsedSource`","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Alan ZimmermanAlan Zimmermanhttps://gitlab.haskell.org/ghc/ghc/-/issues/16230API Annotations: more explicit foralls fixup2019-07-07T18:00:53ZAlan ZimmermanAPI Annotations: more explicit foralls fixupThe `AnnForall` annotations introduced via [D4894](https://phabricator.haskell.org/D4894) are not always attached to the correct `SourceSpan`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| -...The `AnnForall` annotations introduced via [D4894](https://phabricator.haskell.org/D4894) are not always attached to the correct `SourceSpan`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Parser) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"API Annotations: more explicit foralls fixup","status":"New","operating_system":"","component":"Compiler (Parser)","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The `AnnForall` annotations introduced via Phab:D4894 are not always attached to the correct `SourceSpan`.\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Alan ZimmermanAlan Zimmermanhttps://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/16217check-api-annotations should check that an annotation does not precede its span2019-07-07T18:00:56ZAlan Zimmermancheck-api-annotations should check that an annotation does not precede its spanFor an API annotation to be useful, it must not occur before the span it is enclosed in.
So, for `check-api-annotation` output, a line such as
```
((Test16212.hs:3:22-36,AnnOpenP), [Test16212.hs:3:21]),
```
should be flagged as an err...For an API annotation to be useful, it must not occur before the span it is enclosed in.
So, for `check-api-annotation` output, a line such as
```
((Test16212.hs:3:22-36,AnnOpenP), [Test16212.hs:3:21]),
```
should be flagged as an error, as the `AnnOpenP` location of `3:21` precedes its enclosing span of `3:22-26`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.3 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Test Suite |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"check-api-annotations should check that an annotation does not precede its span","status":"New","operating_system":"","component":"Test Suite","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"For an API annotation to be useful, it must not occur before the span it is enclosed in.\r\n\r\nSo, for `check-api-annotation` output, a line such as\r\n\r\n{{{\r\n((Test16212.hs:3:22-36,AnnOpenP), [Test16212.hs:3:21]),\r\n}}}\r\n\r\nshould be flagged as an error, as the `AnnOpenP` location of `3:21` precedes its enclosing span of `3:22-26`.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/16212API Annotations: Parens not attached correctly for ClassDecl2019-07-07T18:00:57ZAlan ZimmermanAPI Annotations: Parens not attached correctly for ClassDeclFor the file
```hs
module ClassParens where
class LiftingMonad (trans :: MTrans) where
proof :: Monad m :- Monad (trans m)
class LiftingMonad2 ((trans :: MTrans)) where
proof :: Monad m :- Monad (trans m)
```
The parens around ...For the file
```hs
module ClassParens where
class LiftingMonad (trans :: MTrans) where
proof :: Monad m :- Monad (trans m)
class LiftingMonad2 ((trans :: MTrans)) where
proof :: Monad m :- Monad (trans m)
```
The parens around the kinded tyvars should be attached to the class declaration as a whole, they are attached to the tyvar instead, outside the span.
An annotation must always be within the span it is contained in.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Parser) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"API Annotations: Parens not attached correctly for ClassDecl","status":"New","operating_system":"","component":"Compiler (Parser)","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"For the file\r\n\r\n{{{#!hs\r\nmodule ClassParens where\r\n\r\nclass LiftingMonad (trans :: MTrans) where\r\n proof :: Monad m :- Monad (trans m)\r\n\r\nclass LiftingMonad2 ((trans :: MTrans)) where\r\n proof :: Monad m :- Monad (trans m)\r\n}}}\r\n\r\nThe parens around the kinded tyvars should be attached to the class declaration as a whole, they are attached to the tyvar instead, outside the span. \r\n\r\nAn annotation must always be within the span it is contained in.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Alan ZimmermanAlan Zimmermanhttps://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.1