[Git][ghc/ghc][master] Handle hs-boot files in -Wmissing-home-modules (#16551)

Marge Bot gitlab at gitlab.haskell.org
Wed May 29 14:35:55 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
c8380a4a by Krzysztof Gogolewski at 2019-05-29T14:35:50Z
Handle hs-boot files in -Wmissing-home-modules (#16551)

- - - - -


6 changed files:

- compiler/main/GhcMake.hs
- + testsuite/tests/warnings/should_compile/T16551.stderr
- + testsuite/tests/warnings/should_compile/T16551/A.hs
- + testsuite/tests/warnings/should_compile/T16551/B.hs
- + testsuite/tests/warnings/should_compile/T16551/B.hs-boot
- testsuite/tests/warnings/should_compile/all.T


Changes:

=====================================
compiler/main/GhcMake.hs
=====================================
@@ -184,6 +184,10 @@ warnMissingHomeModules hsc_env mod_graph =
     is_my_target mod (TargetFile target_file _)
       | Just mod_file <- ml_hs_file (ms_location mod)
       = target_file == mod_file ||
+
+           --  Don't warn on B.hs-boot if B.hs is specified (#16551)
+           addBootSuffix target_file == mod_file ||
+
            --  We can get a file target even if a module name was
            --  originally specified in a command line because it can
            --  be converted in guessTarget (by appending .hs/.lhs).


=====================================
testsuite/tests/warnings/should_compile/T16551.stderr
=====================================
@@ -0,0 +1,3 @@
+[1 of 3] Compiling B[boot]          ( T16551/B.hs-boot, T16551/B.o-boot )
+[2 of 3] Compiling A                ( T16551/A.hs, T16551/A.o )
+[3 of 3] Compiling B                ( T16551/B.hs, T16551/B.o )


=====================================
testsuite/tests/warnings/should_compile/T16551/A.hs
=====================================
@@ -0,0 +1,2 @@
+module A where
+import {-# SOURCE #-} B


=====================================
testsuite/tests/warnings/should_compile/T16551/B.hs
=====================================
@@ -0,0 +1,2 @@
+module B where
+import A


=====================================
testsuite/tests/warnings/should_compile/T16551/B.hs-boot
=====================================
@@ -0,0 +1 @@
+module B where


=====================================
testsuite/tests/warnings/should_compile/all.T
=====================================
@@ -22,6 +22,7 @@ test('Werror01', normal, compile, [''])
 test('Werror02', normal, compile, [''])
 
 test('MissingMod', normal, multimod_compile, ['MissingMod', '-Wmissing-home-modules'])
+test('T16551', [extra_files(['T16551/'])], multimod_compile, ['T16551/A.hs T16551/B.hs', '-Wmissing-home-modules'])
 
 test('StarBinder', normal, compile, [''])
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/c8380a4a738e5c2488337496b0d1b1faf6a7de9d

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/c8380a4a738e5c2488337496b0d1b1faf6a7de9d
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190529/d5010030/attachment-0001.html>


More information about the ghc-commits mailing list