Skip to content

Commit

Permalink
Add new example to 58481 and rephrase some wording in index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
BinderDavid committed Oct 27, 2024
1 parent d9b88b9 commit 4ed7157
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
4 changes: 4 additions & 0 deletions message-index/messages/GHC-58481/example4/after/Pattern.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{-# LANGUAGE PatternSynonyms #-}
module Pattern where

pattern Head x <- x:xs
4 changes: 4 additions & 0 deletions message-index/messages/GHC-58481/example4/before/Pattern.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

module Pattern where

pattern Head x <- x:xs
14 changes: 14 additions & 0 deletions message-index/messages/GHC-58481/example4/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Use of pattern synonyms without enabled language extension
---

In this example the user declared a pattern synonym without enabling the `PatternSynonym` extension, which leads to this generic parsing error.

```
messages/GHC-58481/example4/before/Pattern.hs:3:16: error: [GHC-58481]
parse error on input ‘<-’
Suggested fix: Possibly caused by a missing 'do'?
|
3 | pattern Head x <- x:xs
| ^^
```
7 changes: 4 additions & 3 deletions message-index/messages/GHC-58481/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ severity: error
introduced: 9.6.1
---

This is a generic error, indicating that GHC could not parse the code.
This is a generic error, indicating that GHC could not parse the code.

GHC contains many more explicit parsing errors with more verbose descriptions of the problem. However if the error is not separately defined there, a problem with parsing is reported with error code 58481.
GHC contains many more explicit parsing errors with more verbose descriptions of the problem.
However if the error is not separately defined there, a problem with parsing is reported with error code `GHC-58481`.

There may be many different reasons why error 58481 was given, ranging from an incorrect syntax that needs additional Haskell Language Extensions, to a expression mistakenly put in the same line as other.
There may be many different reasons why the error `GHC-58481` was emitted, ranging from incorrect syntax that requires additional language extensions, to an expression mistakenly put in the same line as another.

Below are some examples of code that generate this generic parsing error. Please be encouraged to report more or contribute via [error-messages github](https://github.com/haskell/error-messages).

0 comments on commit 4ed7157

Please sign in to comment.