From b7bb99d774fb86209e7993a6bb0ff689799905b4 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 20 Jul 2016 15:56:01 +0100 Subject: [PATCH] fix problems --- src/fsharp/CompileOps.fs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 31ca1a6f2f59..e59c31d36c82 100755 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -4948,7 +4948,10 @@ module private ScriptPreprocessClosure = let loadedSources = (!tcConfig).GetAvailableLoadedSources() |> List.map AddFileIfNotSeen |> List.concat (loadedSources |> List.map FindClosure |> List.concat) - @ [ClosedSourceFile(filename,m,Some(input),!errors,!warnings,!noWarns)] + @ + (if observedSources.HaveSeen(filename) then [] + else [ClosedSourceFile(filename,m,Some(input),!errors,!warnings,!noWarns)]) + | None -> [ClosedSourceFile(filename,m,None,!errors,!warnings,[])] closureDirectives |> List.map FindClosure |> List.concat, !tcConfig @@ -5042,7 +5045,7 @@ module private ScriptPreprocessClosure = /// Used from fsi.fs and fsc.fs, for #load and command line let GetFullClosureOfScriptFiles(tcConfig:TcConfig,files:(string*range) list,codeContext,_useDefaultScriptingReferences:bool,lexResourceManager:Lexhelp.LexResourceManager) = let mainFile = fst (List.head files) - let protoClosure = files |> List.map (fun (filename,m)->SourceFileOfFilename(filename,m,tcConfig.inputCodePage)) |> List.concat |> List.rev // Reverse to put them in the order they will be extracted later + let protoClosure = files |> List.map (fun (filename,m)->SourceFileOfFilename(filename,m,tcConfig.inputCodePage)) |> List.concat // Reverse to put them in the order they will be extracted later let finalClosure,tcConfig = FindClosureDirectives(protoClosure,tcConfig,codeContext,lexResourceManager) GetLoadClosure(mainFile,finalClosure,tcConfig,codeContext)