Update assert to fix retc001 and retc002 (#9243)
authorThomas Miedema <thomasmiedema@gmail.com>
Fri, 17 Jul 2015 09:42:24 +0000 (11:42 +0200)
committerThomas Miedema <thomasmiedema@gmail.com>
Fri, 17 Jul 2015 23:00:49 +0000 (01:00 +0200)
Since 2223e196b2dc5340d70e58be011c279d381b4319, maybe_old_linkable can
be Nothing even with an up-to-date interface file. This happens when
compiling with --make -fno-code -fwrite-interface.

See also Note [Recompilation checking when typechecking only] in
GhcMake.hs.

This fixes retc001 and retc002 when ghc_debugged.

Differential Revision: https://phabricator.haskell.org/D1077

compiler/main/DriverPipeline.hs

index 3affcb1..ff6e81d 100644 (file)
@@ -186,7 +186,7 @@ compileOne' m_tc_result mHscMessage
    case e of
        Left iface ->
            do details <- genModDetails hsc_env iface
-              MASSERT(isJust maybe_old_linkable)
+              MASSERT(isJust maybe_old_linkable || isNoLink (ghcLink dflags))
               return (HomeModInfo{ hm_details  = details,
                                    hm_iface    = iface,
                                    hm_linkable = maybe_old_linkable })