From ab0d7a7adf016562dc9f1872f4b4cc2d55659d71 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 8 Feb 2017 17:55:31 +0000 Subject: [PATCH] don't keep tcEnvAtEnd for background states unless keepAllBackgroundResolutions=true (#2388) --- src/fsharp/vs/IncrementalBuild.fs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fsharp/vs/IncrementalBuild.fs b/src/fsharp/vs/IncrementalBuild.fs index edb85f92e8..04d6bb363d 100755 --- a/src/fsharp/vs/IncrementalBuild.fs +++ b/src/fsharp/vs/IncrementalBuild.fs @@ -1427,8 +1427,8 @@ type IncrementalBuilder(frameworkTcImportsCache: FrameworkImportsCache, tcConfig errorLogger.Warning(e) frameworkTcImports - let tcEnvAtEndOfFile = GetInitialTcEnv (assemblyName, rangeStartup, tcConfig, tcImports, tcGlobals) - let tcState = GetInitialTcState (rangeStartup, assemblyName, tcConfig, tcGlobals, tcImports, niceNameGen, tcEnvAtEndOfFile) + let tcInitial = GetInitialTcEnv (assemblyName, rangeStartup, tcConfig, tcImports, tcGlobals) + let tcState = GetInitialTcState (rangeStartup, assemblyName, tcConfig, tcGlobals, tcImports, niceNameGen, tcInitial) let loadClosureErrors = [ match loadClosureOpt with | None -> () @@ -1442,7 +1442,7 @@ type IncrementalBuilder(frameworkTcImportsCache: FrameworkImportsCache, tcConfig tcImports=tcImports tcState=tcState tcConfig=tcConfig - tcEnvAtEndOfFile=tcEnvAtEndOfFile + tcEnvAtEndOfFile=tcInitial tcResolutions=[] tcSymbolUses=[] topAttribs=None @@ -1479,6 +1479,7 @@ type IncrementalBuilder(frameworkTcImportsCache: FrameworkImportsCache, tcConfig /// Only keep the typed interface files when doing a "full" build for fsc.exe, otherwise just throw them away let typedImplFiles = if keepAssemblyContents then typedImplFiles else [] let tcResolutions = if keepAllBackgroundResolutions then sink.GetResolutions() else TcResolutions.Empty + let tcEnvAtEndOfFile = (if keepAllBackgroundResolutions then tcEnvAtEndOfFile else tcState.TcEnvFromImpls) let tcSymbolUses = sink.GetSymbolUses() fileChecked.Trigger (filename) return {tcAcc with tcState=tcState