@@ -1612,28 +1612,38 @@ let GetFsiLibraryName () = "FSharp.Compiler.Interactive.Settings"
16121612// -- for orphaned files (files in VS without a project context)
16131613// -- for files given on a command line without --noframework set
16141614let DefaultBasicReferencesForOutOfProjectSources =
1615- [ yield " System"
1615+ [ // These are .NET-Framework -style references
1616+ #if ! TODO_ REWORK_ ASSEMBLY_ LOAD
1617+ yield " System"
16161618 yield " System.Xml"
16171619 yield " System.Runtime.Remoting"
16181620 yield " System.Runtime.Serialization.Formatters.Soap"
16191621 yield " System.Data"
16201622 yield " System.Drawing"
1621-
1622- // Don't reference System.Core for .NET 2.0 compilations.
1623- //
1624- // We only use a default reference to System.Core if one exists which we can load it into the compiler process.
1625- // Note: this is not a partiuclarly good technique as it relying on the environment the compiler is executing in
1626- // to determine the default references. However, System.Core will only fail to load on machines with only .NET 2.0,
1627- // in which case the compiler will also be running as a .NET 2.0 process.
1628- //
1629- // NOTE: it seems this can now be removed now that .NET 4.x is minimally assumed when using this toolchain
1630- if ( try System.Reflection.Assembly.Load( new System.Reflection.AssemblyName( " System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" )) |> ignore; true with _ -> false ) then
1631- yield " System.Core"
1623+ yield " System.Core"
1624+ #endif
16321625
1633- yield " System.Runtime"
1626+ // These are the Portable-profile and .NET Standard 1.6 dependencies of FSharp.Core.dll. These are needed
1627+ // when an F# sript references an F# profile 7, 78, 259 or .NET Standard 1.6 component which in turn refers
1628+ // to FSharp.Core for profile 7, 78, 259 or .NET Standard.
1629+ yield " System.Runtime" // lots of types
1630+ yield " System.Linq" // System.Linq.Expressions.Expression<T>
1631+ yield " System.Reflection" // System.Reflection.ParameterInfo
1632+ yield " System.Linq.Expressions" // System.Linq.IQueryable<T>
1633+ yield " System.Threading.Tasks" // valuetype [System.Threading.Tasks]System.Threading.CancellationToken
1634+ yield " System.IO" // System.IO.TextWriter
1635+ //yield "System.Console" // System.Console.Out etc.
1636+ yield " System.Net.Requests" // System.Net.WebResponse etc.
1637+ yield " System.Collections" // System.Collections.Generic.List<T>
1638+ yield " System.Runtime.Numerics" // BigInteger
1639+ yield " System.Threading" // OperationCanceledException
1640+
1641+ #if ! TODO_ REWORK_ ASSEMBLY_ LOAD
16341642 yield " System.Web"
16351643 yield " System.Web.Services"
1636- yield " System.Windows.Forms" ]
1644+ yield " System.Windows.Forms"
1645+ #endif
1646+ ]
16371647
16381648// Extra implicit references for .NET 4.0
16391649let DefaultBasicReferencesForOutOfProjectSources40 =
@@ -5077,12 +5087,11 @@ let GetInitialTcEnv (thisAssemblyName:string, initm:range, tcConfig:TcConfig, tc
50775087
50785088 let tcEnv = CreateInitialTcEnv( tcGlobals, amap, initm, thisAssemblyName, ccus)
50795089
5080- let tcEnv =
5081- if tcConfig.checkOverflow then
5082- TcOpenDecl TcResultsSink.NoSink tcGlobals amap initm initm tcEnv ( pathToSynLid initm ( splitNamespace FSharpLib.CoreOperatorsCheckedName))
5083- else
5084- tcEnv
5085- tcEnv
5090+ if tcConfig.checkOverflow then
5091+ try TcOpenDecl TcResultsSink.NoSink tcGlobals amap initm initm tcEnv ( pathToSynLid initm ( splitNamespace FSharpLib.CoreOperatorsCheckedName))
5092+ with e -> errorRecovery e initm; tcEnv
5093+ else
5094+ tcEnv
50865095
50875096//----------------------------------------------------------------------------
50885097// Fault injection
0 commit comments