summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2016-05-13 19:32:37 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2016-08-21 00:53:21 -0700
commite528061e2779ce475927f44d817eaf15a02cbac7 (patch)
treebf2c9c8003a46ae673f63e22ac1ce02c85c01f85
parent8fd184887e7c240c7089367c6f737fa66cf409fc (diff)
downloadhaskell-e528061e2779ce475927f44d817eaf15a02cbac7.tar.gz
We also need to retypecheck before when we do parallel make.
Summary: Kept this seperate from the previous patch for clarity. Comes with a test. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2220 GHC Trac Issues: #12035
-rw-r--r--compiler/main/GhcMake.hs13
-rw-r--r--testsuite/driver/extra_files.py1
-rw-r--r--testsuite/tests/typecheck/should_fail/T12035j.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T2
4 files changed, 20 insertions, 2 deletions
diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs
index 1130d6f2e7..d67a12061b 100644
--- a/compiler/main/GhcMake.hs
+++ b/compiler/main/GhcMake.hs
@@ -1048,9 +1048,18 @@ parUpsweep_one mod home_mod_map comp_graph_loops lcl_dflags cleanup par_sem
let lcl_mod = localize_mod mod
let lcl_hsc_env = localize_hsc_env hsc_env
+ -- Re-typecheck the loop
+ type_env_var <- liftIO $ newIORef emptyNameEnv
+ let lcl_hsc_env' = lcl_hsc_env { hsc_type_env_var =
+ Just (ms_mod lcl_mod, type_env_var) }
+ lcl_hsc_env'' <- case finish_loop of
+ Nothing -> return lcl_hsc_env'
+ Just loop -> typecheckLoop lcl_dflags lcl_hsc_env' $
+ map (moduleName . fst) loop
+
-- Compile the module.
- mod_info <- upsweep_mod lcl_hsc_env old_hpt stable_mods lcl_mod
- mod_index num_mods
+ mod_info <- upsweep_mod lcl_hsc_env'' old_hpt stable_mods
+ lcl_mod mod_index num_mods
return (Just mod_info)
case mb_mod_info of
diff --git a/testsuite/driver/extra_files.py b/testsuite/driver/extra_files.py
index 49cf901ae2..acf4802cba 100644
--- a/testsuite/driver/extra_files.py
+++ b/testsuite/driver/extra_files.py
@@ -83,6 +83,7 @@ extra_src_files = {
'T11824': ['TyCon.hs', 'Type.hs', 'Type.hs-boot', 'Unbound/'],
'T11827': ['A.hs', 'A.hs-boot', 'B.hs'],
'T12062': ['A.hs', 'A.hs-boot', 'C.hs'],
+ 'T12035j': ['T12035.hs', 'T12035a.hs', 'T12035.hs-boot'],
'T1372': ['p1/', 'p2/'],
'T1407': ['A.c'],
'T1959': ['B.hs', 'C.hs', 'D.hs', 'E1.hs', 'E2.hs'],
diff --git a/testsuite/tests/typecheck/should_fail/T12035j.stderr b/testsuite/tests/typecheck/should_fail/T12035j.stderr
new file mode 100644
index 0000000000..c05966ea09
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12035j.stderr
@@ -0,0 +1,6 @@
+
+T12035.hs:3:1: error:
+ Type constructor ‘T’ has conflicting definitions in the module
+ and its hs-boot file
+ Main module: type T = Bool
+ Boot file: abstract T
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 37d74c6841..dda2a7d1c8 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -420,6 +420,8 @@ test('T11990a', normal, compile_fail, [''])
test('T11990b', normal, compile_fail, [''])
test('T12035', extra_clean(['T12035.hi-boot', 'T12035.o-boot', 'T12035a.hi', 'T12035a.o']),
multimod_compile_fail, ['T12035', '-v0'])
+test('T12035j', extra_clean(['T12035.hi-boot', 'T12035.o-boot', 'T12035a.hi', 'T12035a.o']),
+ multimod_compile_fail, ['T12035', '-j2 -v0'])
test('T12063', [ expect_broken(12063), extra_clean(['T12063.hi-boot', 'T12063.o-boot', 'T12063a.hi', 'T12063a.o']) ],
multimod_compile_fail, ['T12063', '-v0'])
test('T11974b', normal, compile_fail, [''])