Commit 7bfb30f9 authored by Matthew Pickering's avatar Matthew Pickering Committed by Marge Bot
Browse files

Augment target filepath by working directory when checking if module satisfies target

This fixes a spurious warning in -Wmissing-home-modules.

This is a simple oversight where when looking for the target in the
first place we augment the search by the -working-directory flag but
then fail to do so when checking this warning.

Fixes #22676
parent 1d1dd3fb
......@@ -347,7 +347,7 @@ warnMissingHomeModules dflags targets mod_graph =
TargetFile target_file _
| Just mod_file <- ml_hs_file (ms_location mod)
->
target_file == mod_file ||
augmentByWorkingDirectory dflags target_file == mod_file ||
-- Don't warn on B.hs-boot if B.hs is specified (#16551)
addBootSuffix target_file == mod_file ||
......
......@@ -55,3 +55,4 @@ test('T18862b', normal, compile, [''])
test('T20312', normal, compile,['-Wall'])
test('T22151', normal, compile, ['-Wredundant-constraints'])
test('T22759', normal, compile, [''])
test('T22676', [extra_files(['src'])], multimod_compile, ['src.hs', '-working-dir src -Wmissing-home-modules -v0'])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment