 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Flycheck integration
 
-(defvar-local intero-check-last-mod-time nil
-  "Most recent modification time of the current buffer when flycheck was last triggered.")
+(defvar-local intero-check-last-hash nil
+  "Most recent hash for the current buffer when flycheck was last triggered.")
 
 (defvar-local intero-check-last-results nil
   "Most recent flycheck results for the current buffer.")
 
-(defun intero-check-reuse-last-results (mod-time cont)
-  "If MOD-TIME is not new, return non-nil and call CONT with `intero-check-last-results'."
-  (let ((reuse (and intero-check-last-mod-time
-                    (equal mod-time intero-check-last-mod-time)
-                    ;; Cached results are assumed invalid after a backend restart
-                    (time-less-p (with-current-buffer (intero-buffer 'backend)
-                                   intero-start-time)
-                                 intero-check-last-mod-time))))
+(defun intero-check-reuse-last-results (hash cont)
+  "If HASH is not new, return non-nil and call CONT with `intero-check-last-results'."
+  (let ((reuse (and intero-check-last-hash
+                    (equal hash intero-check-last-hash))))
     (progn
       (when reuse
         (funcall cont 'finished intero-check-last-results))

                      'interrupted)
    (let* ((file-buffer (current-buffer))
           (temp-file (intero-localize-path (intero-temp-file-name)))
           (mod-time (nth 5 (file-attributes temp-file))))
      (unless (intero-check-reuse-last-results mod-time cont)
        (intero-async-call
         'backend
         (concat ":l " temp-file)
         (list :cont cont
               :file-buffer file-buffer
               :mod-time mod-time
               :checker checker)
         (lambda (state string)
           (with-current-buffer (plist-get state :file-buffer)
             (unless (intero-check-reuse-last-results (plist-get state :mod-time)
                                                      (plist-get state :cont))
               (let* ((compile-ok (string-match "OK, modules loaded: \\(.*\\)\\.$" string))
                      (modules (match-string 1 string))

                 (let ((results (cl-remove-if (lambda (msg)
                                                (eq 'splice (flycheck-error-level msg)))
                                              msgs)))
                   (setq intero-check-last-hash (plist-get state :hash)
                         intero-check-last-results results)
                   (funcall (plist-get state :cont) 'finished results))
                 (when compile-ok
