Improve error message for #2739 (but no fix).
authorThomas Schilling <nominolo@googlemail.com>
Thu, 27 Nov 2008 13:57:25 +0000 (13:57 +0000)
committerThomas Schilling <nominolo@googlemail.com>
Thu, 27 Nov 2008 13:57:25 +0000 (13:57 +0000)
This patch changes 'loadModule' to define a fake linkable.  The
previous implementation of providing no linkable at all violated a
pre-condition in the ByteCode linker.  This doesn't fix #2739, but it
improves the error message a bit.

compiler/main/GHC.hs

index 08ae664..8ac38ae 100644 (file)
@@ -1099,7 +1099,9 @@ loadModule tcm = do
          let mod_info = HomeModInfo {
                           hm_iface = iface,
                           hm_details = details,
-                          hm_linkable = Nothing }
+                          hm_linkable = Just (LM (ms_hs_date ms)
+                                                 (ms_mod ms)
+                                                 []) }
          hsc_env <- getSession
          return $ addToUFM (hsc_HPT hsc_env) mod mod_info
    modifySession $ \e -> e{ hsc_HPT = hpt_new }