Error reporting on obsolete file
I have just had this warning:
Whatever.hs:41:1: warning: [-Wunused-imports] The import of ‘Data.Map’ is redundant except perhaps to import instances from ‘Data.Map’ To import instances alone, use: import Data.Map() | 41 | import Data.Foldable | ^^^^^^^^^^^^^^^^^^^^^
This happens because the source file has been modified during the compilation: GHC shows an excerpt of the new file to report an error in the old file. Could we cache the old file somehow during the compilation to avoid this discrepancy?