@@ -1579,9 +1579,9 @@ let OutputErrorOrWarningContext prefix fileLineFn os err =
15791579let GetFSharpCoreLibraryName () = " FSharp.Core"
15801580
15811581type internal TypeInThisAssembly = class end
1582- let GetFSharpCoreReferenceUsedByCompiler ( useMonoResolution ) =
1582+ let GetFSharpCoreReferenceUsedByCompiler ( useSimpleResolution ) =
15831583 // On Mono, there is no good reference resolution
1584- if useMonoResolution then
1584+ if useSimpleResolution then
15851585 GetFSharpCoreLibraryName()+ " .dll"
15861586 else
15871587 let fsCoreName = GetFSharpCoreLibraryName()
@@ -1698,8 +1698,8 @@ let SystemAssemblies primaryAssemblyName =
16981698//
16991699// REVIEW: it isn't clear if there is any negative effect
17001700// of leaving an assembly off this list.
1701- let BasicReferencesForScriptLoadClosure ( useMonoResolution , useFsiAuxLib ) =
1702- [ " mscorlib" ; GetFSharpCoreReferenceUsedByCompiler( useMonoResolution ) ] @ // Need to resolve these explicitly so they will be found in the reference assemblies directory which is where the .xml files are.
1701+ let BasicReferencesForScriptLoadClosure ( useSimpleResolution , useFsiAuxLib ) =
1702+ [ " mscorlib" ; GetFSharpCoreReferenceUsedByCompiler( useSimpleResolution ) ] @ // Need to resolve these explicitly so they will be found in the reference assemblies directory which is where the .xml files are.
17031703 DefaultBasicReferencesForOutOfProjectSources @
17041704 [ if useFsiAuxLib then yield GetFsiLibraryName () ]
17051705
@@ -2011,7 +2011,7 @@ type TcConfigBuilder =
20112011 mutable resolutionAssemblyFoldersConditions : string ;
20122012 mutable platform : ILPlatform option ;
20132013 mutable prefer32Bit : bool ;
2014- mutable useMonoResolution : bool
2014+ mutable useSimpleResolution : bool
20152015 mutable target : CompilerTarget
20162016 mutable debuginfo : bool
20172017 mutable testFlagEmitFeeFeeAs100001 : bool ;
@@ -2176,11 +2176,7 @@ type TcConfigBuilder =
21762176 resolutionAssemblyFoldersConditions = " " ;
21772177 platform = None;
21782178 prefer32Bit = false ;
2179- #if ENABLE_ MONO_ SUPPORT
2180- useMonoResolution = runningOnMono
2181- #else
2182- useMonoResolution = false
2183- #endif
2179+ useSimpleResolution = runningOnMono
21842180 target = ConsoleExe
21852181 debuginfo = false
21862182 testFlagEmitFeeFeeAs100001 = false
@@ -2531,7 +2527,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
25312527 match fileNameOpt with
25322528 | None ->
25332529 // if FSharp.Core was not provided explicitly - use version that was referenced by compiler
2534- AssemblyReference( range0, GetFSharpCoreReferenceUsedByCompiler( data.useMonoResolution ), None), None
2530+ AssemblyReference( range0, GetFSharpCoreReferenceUsedByCompiler( data.useSimpleResolution ), None), None
25352531 | _ -> res
25362532 let primaryAssemblyCcuInitializer = getSystemRuntimeInitializer data.primaryAssembly ( computeKnownDllReference >> fst)
25372533
@@ -2667,7 +2663,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
26672663 member x.resolutionAssemblyFoldersConditions = data. resolutionAssemblyFoldersConditions
26682664 member x.platform = data.platform
26692665 member x.prefer32Bit = data.prefer32Bit
2670- member x.useMonoResolution = data.useMonoResolution
2666+ member x.useSimpleResolution = data.useSimpleResolution
26712667 member x.target = data.target
26722668 member x.debuginfo = data.debuginfo
26732669 member x.testFlagEmitFeeFeeAs100001 = data.testFlagEmitFeeFeeAs100001
@@ -2942,7 +2938,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
29422938 // NOTE!! if mode=ReportErrors then this method must not raise exceptions. It must just report the errors and recover
29432939 static member TryResolveLibsUsingMSBuildRules ( tcConfig : TcConfig , originalReferences : AssemblyReference list , errorAndWarningRange : range , mode : ResolveAssemblyReferenceMode ) : AssemblyResolution list * UnresolvedAssemblyReference list =
29442940 use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind ( BuildPhase.Parameter)
2945- if tcConfig.useMonoResolution then
2941+ if tcConfig.useSimpleResolution then
29462942 failwith " MSBuild resolution is not supported."
29472943 if originalReferences=[] then [],[]
29482944 else
@@ -3450,7 +3446,7 @@ type TcAssemblyResolutions(results : AssemblyResolution list, unresolved : Unres
34503446
34513447 static member Resolve ( tcConfig : TcConfig , assemblyList : AssemblyReference list , knownUnresolved : UnresolvedAssemblyReference list ) : TcAssemblyResolutions =
34523448 let resolved , unresolved =
3453- if tcConfig.useMonoResolution then
3449+ if tcConfig.useSimpleResolution then
34543450 let resolutions =
34553451 assemblyList
34563452 |> List.map ( fun assemblyReference ->
@@ -4449,7 +4445,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
44494445 | Some assemblyResolution ->
44504446 ResultD [ assemblyResolution]
44514447 | None ->
4452- if tcConfigP.Get() .useMonoResolution then
4448+ if tcConfigP.Get() .useSimpleResolution then
44534449 let action =
44544450 match mode with
44554451 | ResolveAssemblyReferenceMode.ReportErrors -> CcuLoadFailureAction.RaiseError
@@ -4857,15 +4853,15 @@ module private ScriptPreprocessClosure =
48574853 ParseOneInputLexbuf ( tcConfig, lexResourceManager, defines, lexbuf, filename, isLastCompiland, errorLogger)
48584854
48594855 /// Create a TcConfig for load closure starting from a single .fsx file
4860- let CreateScriptSourceTcConfig ( filename : string , codeContext , useMonoResolution , useFsiAuxLib , basicReferences , applyCommandLineArgs ) =
4856+ let CreateScriptSourceTcConfig ( filename : string , codeContext , useSimpleResolution , useFsiAuxLib , basicReferences , applyCommandLineArgs ) =
48614857 let projectDir = Path.GetDirectoryName( filename)
48624858 let isInteractive = ( codeContext = CodeContext.Evaluation)
48634859 let isInvalidationSupported = ( codeContext = CodeContext.Editing)
48644860 // always use primary assembly = mscorlib for scripts
48654861 let tcConfigB = TcConfigBuilder.CreateNew( Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler.Value, true (* optimize for memory *) , projectDir, isInteractive, isInvalidationSupported)
48664862 applyCommandLineArgs tcConfigB
48674863 match basicReferences with
4868- | None -> BasicReferencesForScriptLoadClosure( useMonoResolution , useFsiAuxLib) |> List.iter( fun f -> tcConfigB.AddReferencedAssemblyByPath( range0, f)) // Add script references
4864+ | None -> BasicReferencesForScriptLoadClosure( useSimpleResolution , useFsiAuxLib) |> List.iter( fun f -> tcConfigB.AddReferencedAssemblyByPath( range0, f)) // Add script references
48694865 | Some rs -> for m, r in rs do tcConfigB.AddReferencedAssemblyByPath( m, r)
48704866
48714867 tcConfigB.resolutionEnvironment <-
@@ -5026,18 +5022,18 @@ module private ScriptPreprocessClosure =
50265022 result
50275023
50285024 /// Given source text, find the full load closure. Used from service.fs, when editing a script file
5029- let GetFullClosureOfScriptSource ( filename , source , codeContext , useMonoResolution , useFsiAuxLib , lexResourceManager : Lexhelp.LexResourceManager , applyCommmandLineArgs ) =
5025+ let GetFullClosureOfScriptSource ( filename , source , codeContext , useSimpleResolution , useFsiAuxLib , lexResourceManager : Lexhelp.LexResourceManager , applyCommmandLineArgs ) =
50305026 // Resolve the basic references such as FSharp.Core.dll first, before processing any #I directives in the script
50315027 //
50325028 // This is tries to mimic the action of running the script in F# Interactive - the initial context for scripting is created
50335029 // first, then #I and other directives are processed.
50345030 let references0 =
5035- let tcConfig = CreateScriptSourceTcConfig( filename, codeContext, useMonoResolution , useFsiAuxLib, None, applyCommmandLineArgs)
5031+ let tcConfig = CreateScriptSourceTcConfig( filename, codeContext, useSimpleResolution , useFsiAuxLib, None, applyCommmandLineArgs)
50365032 let resolutions0 , _unresolvedReferences = GetAssemblyResolutionInformation( tcConfig)
50375033 let references0 = resolutions0 |> List.map ( fun r -> r.originalReference.Range, r.resolvedPath) |> Seq.distinct |> List.ofSeq
50385034 references0
50395035
5040- let tcConfig = CreateScriptSourceTcConfig( filename, codeContext, useMonoResolution , useFsiAuxLib, Some references0, applyCommmandLineArgs)
5036+ let tcConfig = CreateScriptSourceTcConfig( filename, codeContext, useSimpleResolution , useFsiAuxLib, Some references0, applyCommmandLineArgs)
50415037
50425038 let protoClosure = [ SourceFile( filename, range0, source)]
50435039 let finalClosure , tcConfig = FindClosureDirectives( protoClosure, tcConfig, codeContext, lexResourceManager)
@@ -5053,9 +5049,9 @@ module private ScriptPreprocessClosure =
50535049
50545050type LoadClosure with
50555051 // Used from service.fs, when editing a script file
5056- static member ComputeClosureOfSourceText ( filename : string , source : string , codeContext , useMonoResolution : bool , useFsiAuxLib , lexResourceManager : Lexhelp.LexResourceManager , applyCommmandLineArgs ) : LoadClosure =
5052+ static member ComputeClosureOfSourceText ( filename : string , source : string , codeContext , useSimpleResolution : bool , useFsiAuxLib , lexResourceManager : Lexhelp.LexResourceManager , applyCommmandLineArgs ) : LoadClosure =
50575053 use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind ( BuildPhase.Parse)
5058- ScriptPreprocessClosure.GetFullClosureOfScriptSource( filename, source, codeContext, useMonoResolution , useFsiAuxLib, lexResourceManager, applyCommmandLineArgs)
5054+ ScriptPreprocessClosure.GetFullClosureOfScriptSource( filename, source, codeContext, useSimpleResolution , useFsiAuxLib, lexResourceManager, applyCommmandLineArgs)
50595055
50605056 /// Used from fsi.fs and fsc.fs, for #load and command line.
50615057 /// The resulting references are then added to a TcConfig.
@@ -5323,7 +5319,7 @@ let TypeCheckSingleInputAndFinishEventually(checkForErrors, tcConfig: TcConfig,
53235319 return TypeCheckMultipleInputsFinish([ results], tcState)
53245320 }
53255321
5326- let TypeCheckClosedInputSetFinish ( mimpls , tcState ) =
5322+ let TypeCheckClosedInputSetFinish ( declaredImpls : TypedImplFile list , tcState ) =
53275323 // Publish the latest contents to the CCU
53285324 tcState.tcsCcu.Deref.Contents <- tcState.tcsCcuType
53295325
@@ -5333,12 +5329,11 @@ let TypeCheckClosedInputSetFinish (mimpls, tcState) =
53335329 if not ( Zset.contains qualNameOfFile rootImpls) then
53345330 errorR( Error( FSComp.SR.buildSignatureWithoutImplementation( qualNameOfFile.Text), qualNameOfFile.Range)))
53355331
5336- let tassembly = TAssembly( mimpls)
5337- tcState, tassembly
5332+ tcState, declaredImpls
53385333
53395334let TypeCheckClosedInputSet ( checkForErrors , tcConfig , tcImports , tcGlobals , prefixPathOpt , tcState , inputs ) =
53405335 // tcEnvAtEndOfLastFile is the environment required by fsi.exe when incrementally adding definitions
53415336 let ( tcEnvAtEndOfLastFile , topAttrs , mimpls ), tcState = TypeCheckMultipleInputs ( checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, inputs)
5342- let tcState , tassembly = TypeCheckClosedInputSetFinish ( mimpls, tcState)
5343- tcState, topAttrs, tassembly , tcEnvAtEndOfLastFile
5337+ let tcState , declaredImpls = TypeCheckClosedInputSetFinish ( mimpls, tcState)
5338+ tcState, topAttrs, declaredImpls , tcEnvAtEndOfLastFile
53445339
0 commit comments