GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2021-02-18T12:20:49Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/10498"if ... then \case -> else ..." causes a "missing else clause" error2021-02-18T12:20:49Zdramforever"if ... then \case -> else ..." causes a "missing else clause" errorThe following program:
```hs
{-# LANGUAGE LambdaCase #-}
foo =
if True
then
\case ->
1 -> 2
else id
```
Produces this message:
```
problem.hs:4:5:
parse error in if statement: missing required else...The following program:
```hs
{-# LANGUAGE LambdaCase #-}
foo =
if True
then
\case ->
1 -> 2
else id
```
Produces this message:
```
problem.hs:4:5:
parse error in if statement: missing required else clause
```
The problem in the code is that there's a -\> after the \\case.
I don't know if a better error message can be generated, but this one is really unhelpful.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 7.10.1 |
| 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":"\"if ... then \\case -> else ...\" causes a \"missing else clause\" error","status":"New","operating_system":"","component":"Compiler (Parser)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.10.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE LambdaCase #-}\r\n\r\nfoo =\r\n if True\r\n then\r\n \\case ->\r\n 1 -> 2\r\n else id\r\n}}}\r\n\r\nProduces this message:\r\n\r\n{{{\r\nproblem.hs:4:5:\r\n parse error in if statement: missing required else clause\r\n}}}\r\n\r\nThe problem in the code is that there's a -> after the \\case. \r\n\r\nI don't know if a better error message can be generated, but this one is really unhelpful.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.3https://gitlab.haskell.org/ghc/ghc/-/issues/10700include/stg/Prim.h isn't C++ compatible2019-07-07T18:34:35ZFabianinclude/stg/Prim.h isn't C++ compatibleStgWord hs_cmpxchg8(volatile StgWord8 \*x, StgWord old, StgWord new);
and a few other declarations in Prim.h causes problems as they use *new* as a variable name.
<details><summary>Trac metadata</summary>
| Trac field | Va...StgWord hs_cmpxchg8(volatile StgWord8 \*x, StgWord old, StgWord new);
and a few other declarations in Prim.h causes problems as they use *new* as a variable name.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.10.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"include/stg/Prim.h isn't C++ compatible","status":"New","operating_system":"","component":"Build System","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.10.1","keywords":["FFI"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new);\r\n\r\nand a few other declarations in Prim.h causes problems as they use ''new'' as a variable name.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.3rasenrasenhttps://gitlab.haskell.org/ghc/ghc/-/issues/10810Data constructor operators mis-printed in Template Haskell2019-07-07T18:33:46ZRichard Eisenbergrae@richarde.devData constructor operators mis-printed in Template HaskellWhen I say
```
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-}
module Bug where
$([d| data Foo = (:!) |])
```
I get
```
Bug.hs:6:3-24: Splicing declarations
[d| data Foo = :! |] ======> dat...When I say
```
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-}
module Bug where
$([d| data Foo = (:!) |])
```
I get
```
Bug.hs:6:3-24: Splicing declarations
[d| data Foo = :! |] ======> data Foo = :!
```
There are missing parentheses in that output.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 7.10.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Template Haskell |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Data constructor operators mis-printed in Template Haskell","status":"New","operating_system":"","component":"Template Haskell","related":[],"milestone":"7.12.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.10.2","keywords":["newcomer"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"When I say\r\n\r\n{{{\r\n{-# LANGUAGE TemplateHaskell #-}\r\n{-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-}\r\n\r\nmodule Bug where\r\n\r\n$([d| data Foo = (:!) |])\r\n}}}\r\n\r\nI get\r\n\r\n{{{\r\nBug.hs:6:3-24: Splicing declarations\r\n [d| data Foo = :! |] ======> data Foo = :!\r\n}}}\r\n\r\nThere are missing parentheses in that output.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.3