-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #446 from jhrcek/GHC-42044
Document GHC-42044
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
message-index/messages/GHC-42044/example1/after/UnrecognisedPragmas.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{-# LANGUAGE BangPatterns #-} | ||
{-# OPTIONS_HUGS #-} | ||
module UnrecognisedPragmas where | ||
|
||
x :: Int | ||
x = 42 | ||
{-# INLINE x #-} |
11 changes: 11 additions & 0 deletions
11
message-index/messages/GHC-42044/example1/before/UnrecognisedPragmas.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{-# LANGUGE BangPatterns #-} | ||
-- ^ missing A | ||
{-# OPTION_HUGS #-} | ||
-- ^ missing S | ||
module UnrecognisedPragmas where | ||
|
||
x :: Int | ||
x = 42 | ||
{-# INLNE x #-} | ||
-- ^ missing I | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: Misspelled pragmas | ||
--- | ||
|
||
Typos in pragma names leads to warnings being emitted. Fixing the typos makes the warnings go away. | ||
|
||
## Error Message | ||
``` | ||
UnrecognisedPragmas.hs:1:1: warning: [GHC-42044] [-Wunrecognised-pragmas] | ||
Unrecognised pragma: LANGUGE | ||
Suggested fix: Perhaps you meant ‘LANGUAGE’ | ||
| | ||
1 | {-# LANGUGE BangPatterns #-} | ||
| ^^^^^^^^^^^ | ||
UnrecognisedPragmas.hs:3:1: warning: [GHC-42044] [-Wunrecognised-pragmas] | ||
Unrecognised pragma: OPTION_HUGS | ||
Suggested fix: Perhaps you meant ‘OPTIONS_HUGS’ | ||
| | ||
3 | {-# OPTION_HUGS #-} | ||
| ^^^^^^^^^^^^^^^ | ||
UnrecognisedPragmas.hs:9:1: warning: [GHC-42044] [-Wunrecognised-pragmas] | ||
Unrecognised pragma: INLNE | ||
Suggested fix: Perhaps you meant ‘INLINE’ | ||
| | ||
9 | {-# INLNE x #-} | ||
| ^^^^^^^^^ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Unrecognised pragma | ||
summary: GHC didn't recognize pragma and will thus ignore it | ||
severity: warning | ||
flag: -Wunrecognised-pragmas | ||
introduced: 9.6.1 | ||
--- | ||
|
||
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. | ||
|
||
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). |