From babb47d263e0df0fa4e16da6bf86164a2a3e07ea Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Fri, 19 Nov 2021 14:21:58 +0530 Subject: 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 --- testsuite/tests/stranal/should_compile/str001.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite/tests/stranal') diff --git a/testsuite/tests/stranal/should_compile/str001.hs b/testsuite/tests/stranal/should_compile/str001.hs index 6d27a923fd..332fa1d56c 100644 --- a/testsuite/tests/stranal/should_compile/str001.hs +++ b/testsuite/tests/stranal/should_compile/str001.hs @@ -1,7 +1,7 @@ {-# LANGUAGE DatatypeContexts #-} +{-# OPTIONS -O #-} module ShouldSucceed where -{-# OPTIONS -O #-} newtype Num a => Point2 a = Point2 (a,a) -- cgit v1.2.1