From f40d8195e67b8a93d59da3ceab42e682c0300dd8 Mon Sep 17 00:00:00 2001 From: Alfonso Garcia-Caro Date: Mon, 27 Jun 2016 10:41:17 +0200 Subject: [PATCH] Fix file ordering when getting script options --- src/fsharp/CompileOps.fs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 49c11ad003..b32174f885 100755 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -4947,7 +4947,8 @@ module private ScriptPreprocessClosure = [ClosedSourceFile(filename,m,None,[],[],[])] // Don't traverse into .fs leafs. let loadedSources = (!tcConfig).GetAvailableLoadedSources() |> List.rev |> List.map AddFileIfNotSeen |> List.concat - ClosedSourceFile(filename,m,Some(input),!errors,!warnings,!noWarns) :: loadedSources |> List.map FindClosure |> List.concat // Final closure is in reverse order. Keep the closed source at the top. + (loadedSources |> List.map FindClosure |> List.concat) + @ [ClosedSourceFile(filename,m,Some(input),!errors,!warnings,!noWarns)] | None -> [ClosedSourceFile(filename,m,None,!errors,!warnings,[])] closureDirectives |> List.map FindClosure |> List.concat, !tcConfig @@ -5009,7 +5010,7 @@ module private ScriptPreprocessClosure = let rootWarnings = rootWarnings |> List.filter isRootRange let result : LoadClosure = - { SourceFiles = List.groupByFirst !sourceFiles + { SourceFiles = List.groupByFirst !sourceFiles |> List.rev References = List.groupByFirst references UnresolvedReferences = unresolvedReferences Inputs = !sourceInputs