X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcRnDriver.lhs;h=e26c50b5848e913b942a5c3a1ec1970dc7ef6ad6;hp=4e0f283cdd2cb757d5fd4744c49b39407e05a55d;hb=3c22606bf3114747deeae0a8a1d5832ee834d9d1;hpb=d55443e6ab108ae0570bd92dc19de09b07b4ebfa diff --git a/compiler/typecheck/TcRnDriver.lhs b/compiler/typecheck/TcRnDriver.lhs index 4e0f283..e26c50b 100644 --- a/compiler/typecheck/TcRnDriver.lhs +++ b/compiler/typecheck/TcRnDriver.lhs @@ -728,19 +728,18 @@ tcTopSrcDecls boot_details checkMain :: TcM TcGblEnv -- If we are in module Main, check that 'main' is defined. checkMain - = do { ghc_mode <- getGhcMode ; - tcg_env <- getGblEnv ; + = do { tcg_env <- getGblEnv ; dflags <- getDOpts ; let { main_mod = mainModIs dflags ; main_fn = case mainFunIs dflags of { Just fn -> mkRdrUnqual (mkVarOccFS (mkFastString fn)) ; Nothing -> main_RDR_Unqual } } ; - check_main ghc_mode tcg_env main_mod main_fn + check_main dflags tcg_env main_mod main_fn } -check_main ghc_mode tcg_env main_mod main_fn +check_main dflags tcg_env main_mod main_fn | mod /= main_mod = traceTc (text "checkMain not" <+> ppr main_mod <+> ppr mod) >> return tcg_env @@ -780,8 +779,8 @@ check_main ghc_mode tcg_env main_mod main_fn where mod = tcg_mod tcg_env - complain_no_main | ghc_mode == Interactive = return () - | otherwise = failWithTc noMainMsg + complain_no_main | ghcLink dflags == LinkInMemory = return () + | otherwise = failWithTc noMainMsg -- In interactive mode, don't worry about the absence of 'main' -- In other modes, fail altogether, so that we don't go on -- and complain a second time when processing the export list.