summaryrefslogtreecommitdiff
path: root/testsuite/tests/hiefile
diff options
context:
space:
mode:
authorZubin Duggal <zubin@cmi.ac.in>2020-05-02 18:33:02 +0530
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-05-06 04:41:08 -0400
commit9f3e6884e338015f2953c4c0844e04d467f53dd5 (patch)
treefc4c72e7eb464dc357e2355a364343fad5044664 /testsuite/tests/hiefile
parentb2d72c758233830446230800d0045badc01b42ca (diff)
downloadhaskell-9f3e6884e338015f2953c4c0844e04d467f53dd5.tar.gz
Allow atomic update of NameCache in readHieFile
The situation arises in ghcide where multiple different threads may need to update the name cache, therefore with the older interface it could happen that you start reading a hie file with name cache A and produce name cache A + B, but another thread in the meantime updated the namecache to A + C. Therefore if you write the new namecache you will lose the A' updates from the second thread. Updates haddock submodule
Diffstat (limited to 'testsuite/tests/hiefile')
-rw-r--r--testsuite/tests/hiefile/should_run/PatTypes.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/hiefile/should_run/PatTypes.hs b/testsuite/tests/hiefile/should_run/PatTypes.hs
index 25803d0e47..9f181c8577 100644
--- a/testsuite/tests/hiefile/should_run/PatTypes.hs
+++ b/testsuite/tests/hiefile/should_run/PatTypes.hs
@@ -57,7 +57,7 @@ main = do
libdir:_ <- getArgs
df <- dynFlagsForPrinting libdir
nc <- makeNc
- (hfr, nc') <- readHieFile nc "PatTypes.hie"
+ hfr <- readHieFile (NCU (\f -> pure $ snd $ f nc)) "PatTypes.hie"
let hf = hie_file_result hfr
forM_ [p1,p2,p3,p4] $ \point -> do
putStr $ "At " ++ show point ++ ", got type: "