+ -- Get the dictionary pointer. We won't attempt to actually
+ -- read the dictionary until we've done the version checks below,
+ -- just in case this isn't a valid interface. In retrospect the
+ -- version should have come before the dictionary pointer, but this
+ -- is the way it was done originally, and we can't change it now.
+ dict_p <- Binary.get bh -- Get the dictionary ptr
+
+ -- Check the interface file version and ways.
+ check_ver <- get bh
+ let our_ver = show opt_HiVersion
+ when (check_ver /= our_ver) $
+ -- This will be caught by readIface which will emit an error
+ -- msg containing the iface module name.
+ throwDyn (ProgramError (
+ "mismatched interface file versions: expected "
+ ++ our_ver ++ ", found " ++ check_ver))
+
+ check_way <- get bh
+ ignore_way <- readIORef v_IgnoreHiWay
+ way_descr <- getWayDescr
+ when (not ignore_way && check_way /= way_descr) $
+ -- This will be caught by readIface
+ -- which will emit an error msg containing the iface module name.
+ throwDyn (ProgramError (
+ "mismatched interface file ways: expected "
+ ++ way_descr ++ ", found " ++ check_way))
+