Skip to content

Commit f822461

Browse files
authored
Merge pull request #446 from jhrcek/GHC-42044
Document GHC-42044
2 parents e22a9ac + da2a168 commit f822461

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{-# LANGUAGE BangPatterns #-}
2+
{-# OPTIONS_HUGS #-}
3+
module UnrecognisedPragmas where
4+
5+
x :: Int
6+
x = 42
7+
{-# INLINE x #-}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{-# LANGUGE BangPatterns #-}
2+
-- ^ missing A
3+
{-# OPTION_HUGS #-}
4+
-- ^ missing S
5+
module UnrecognisedPragmas where
6+
7+
x :: Int
8+
x = 42
9+
{-# INLNE x #-}
10+
-- ^ missing I
11+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Misspelled pragmas
3+
---
4+
5+
Typos in pragma names leads to warnings being emitted. Fixing the typos makes the warnings go away.
6+
7+
## Error Message
8+
```
9+
UnrecognisedPragmas.hs:1:1: warning: [GHC-42044] [-Wunrecognised-pragmas]
10+
Unrecognised pragma: LANGUGE
11+
Suggested fix: Perhaps you meant ‘LANGUAGE’
12+
|
13+
1 | {-# LANGUGE BangPatterns #-}
14+
| ^^^^^^^^^^^
15+
16+
UnrecognisedPragmas.hs:3:1: warning: [GHC-42044] [-Wunrecognised-pragmas]
17+
Unrecognised pragma: OPTION_HUGS
18+
Suggested fix: Perhaps you meant ‘OPTIONS_HUGS’
19+
|
20+
3 | {-# OPTION_HUGS #-}
21+
| ^^^^^^^^^^^^^^^
22+
23+
UnrecognisedPragmas.hs:9:1: warning: [GHC-42044] [-Wunrecognised-pragmas]
24+
Unrecognised pragma: INLNE
25+
Suggested fix: Perhaps you meant ‘INLINE’
26+
|
27+
9 | {-# INLNE x #-}
28+
| ^^^^^^^^^
29+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Unrecognised pragma
3+
summary: GHC didn't recognize pragma and will thus ignore it
4+
severity: warning
5+
flag: -Wunrecognised-pragmas
6+
introduced: 9.6.1
7+
---
8+
9+
GHC emits a warning whenever it encounters a pragma which it doesn't recognize. In these cases it just ignores the pragma, which might not be what you want.
10+
11+
This can indicate a typo in the name of the pragma, in which case fixing the typo should make the warning go away. See the GHC User Guide for a list of [supported pragmas](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/pragmas.html).

0 commit comments

Comments
 (0)