X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fiface%2FBinIface.hs;h=ab4ab01a8c3497d7d37ec3ea3445c42e2f39509b;hp=152381c528bdcebaf0c9b3f5dda7063e80dc74bf;hb=0d80489c9b9f2421f65d8dd86c1e50c6bb429715;hpb=724a9e83f9498382e3580d26a7dd7cd6b108408c diff --git a/compiler/iface/BinIface.hs b/compiler/iface/BinIface.hs index 152381c..ab4ab01 100644 --- a/compiler/iface/BinIface.hs +++ b/compiler/iface/BinIface.hs @@ -73,6 +73,12 @@ readBinIface_ checkHiWay traceBinIFaceReading hi_path nc = do = printer (text what <> text ": " <> vcat [text "Wanted " <> ppr wanted <> text ",", text "got " <> ppr got]) + + errorOnMismatch' :: (Eq a, Show a) => String -> a -> a -> IO () -> IO () + errorOnMismatch' what wanted got io + = do when (wanted /= got) $ io + errorOnMismatch what wanted got + errorOnMismatch :: (Eq a, Show a) => String -> a -> a -> IO () errorOnMismatch what wanted got -- This will be caught by readIface which will emit an error