summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-api
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2021-11-19 14:21:58 +0530
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-04-06 13:02:04 -0400
commitbabb47d263e0df0fa4e16da6bf86164a2a3e07ea (patch)
tree63f9ea3a73ca093e10d14e8a368d6adfadc0f895 /testsuite/tests/ghc-api
parentd2ae0a3a1a8e31e5d769f1aea95e85793043cb3a (diff)
downloadhaskell-babb47d263e0df0fa4e16da6bf86164a2a3e07ea.tar.gz
Add warnings for file header pragmas that appear in the body of a module (#20385)
Once we are done parsing the header of a module to obtain the options, we look through the rest of the tokens in order to determine if they contain any misplaced file header pragmas that would usually be ignored, potentially resulting in bad error messages. The warnings are reported immediately so that later errors don't shadow over potentially helpful warnings. Metric Increase: T13719
Diffstat (limited to 'testsuite/tests/ghc-api')
-rw-r--r--testsuite/tests/ghc-api/T10942.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/ghc-api/T10942.hs b/testsuite/tests/ghc-api/T10942.hs
index 06cdcd62e4..a37d279c3a 100644
--- a/testsuite/tests/ghc-api/T10942.hs
+++ b/testsuite/tests/ghc-api/T10942.hs
@@ -21,4 +21,4 @@ main = do
parser_opts = initParserOpts dflags'
setSessionDynFlags dflags'
stringBuffer <- liftIO $ hGetStringBuffer filename
- liftIO $ print (map unLoc (getOptions parser_opts stringBuffer filename))
+ liftIO $ print (map unLoc (snd $ getOptions parser_opts stringBuffer filename))