@@ -142,9 +142,12 @@ getHomeHieFile f = do
142
142
mbHieTimestamp <- use GetModificationTime normal_hie_f
143
143
srcTimestamp <- use_ GetModificationTime f
144
144
145
- let isUpToDate
146
- | Just d <- mbHieTimestamp = comparing modificationTime d srcTimestamp == GT
147
- | otherwise = False
145
+ let isUpToDate = case (modificationTime <$> mbHieTimestamp, modificationTime srcTimestamp) of
146
+ -- If the src file is in VFS, then we know it must have been typechecked
147
+ -- by now (due to kick) and therefore its .hie file is up to date
148
+ (Just _, Nothing ) -> True
149
+ (Just (Just a), Just b) -> a >= b
150
+ _ -> False
148
151
149
152
unless isUpToDate $
150
153
void $ use_ TypeCheck f
@@ -555,8 +558,8 @@ getHiFileRule = defineEarlyCutoff $ \GetHiFile f -> do
555
558
Just deps -> do
556
559
mbHiVersion <- use GetModificationTime hiFile
557
560
modVersion <- use_ GetModificationTime f
558
- case mbHiVersion of
559
- Just hiVersion
561
+ case ( mbHiVersion, modVersion) of
562
+ ( Just hiVersion, ModificationTime {})
560
563
| modificationTime hiVersion >= modificationTime modVersion -> do
561
564
session <- hscEnv <$> use_ GhcSession f
562
565
r <- liftIO $ loadInterface session ms deps
@@ -567,6 +570,8 @@ getHiFileRule = defineEarlyCutoff $ \GetHiFile f -> do
567
570
Left err -> do
568
571
let diag = ideErrorWithSource (Just " interface file loading" ) (Just DsError ) f . T. pack $ err
569
572
return (Nothing , (pure diag, Nothing ))
573
+ (_, VFSVersion {}) ->
574
+ error " internal error - GetHiFile of file of interest"
570
575
_ ->
571
576
pure (Nothing , ([] , Nothing ))
572
577
0 commit comments