@@ -1640,28 +1640,38 @@ let DefaultBasicReferencesForOutOfProjectSources40 = []
16401640
16411641#else
16421642let DefaultBasicReferencesForOutOfProjectSources =
1643- [ yield " System"
1643+ [ // These are .NET-Framework -style references
1644+ #if ! TODO_ REWORK_ ASSEMBLY_ LOAD
1645+ yield " System"
16441646 yield " System.Xml"
16451647 yield " System.Runtime.Remoting"
16461648 yield " System.Runtime.Serialization.Formatters.Soap"
16471649 yield " System.Data"
16481650 yield " System.Drawing"
1649-
1650- // Don't reference System.Core for .NET 2.0 compilations.
1651- //
1652- // We only use a default reference to System.Core if one exists which we can load it into the compiler process.
1653- // Note: this is not a partiuclarly good technique as it relying on the environment the compiler is executing in
1654- // to determine the default references. However, System.Core will only fail to load on machines with only .NET 2.0,
1655- // in which case the compiler will also be running as a .NET 2.0 process.
1656- //
1657- // NOTE: it seems this can now be removed now that .NET 4.x is minimally assumed when using this toolchain
1658- 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
1659- yield " System.Core"
1651+ yield " System.Core"
1652+ #endif
16601653
1661- yield " System.Runtime"
1654+ // These are the Portable-profile and .NET Standard 1.6 dependencies of FSharp.Core.dll. These are needed
1655+ // when an F# sript references an F# profile 7, 78, 259 or .NET Standard 1.6 component which in turn refers
1656+ // to FSharp.Core for profile 7, 78, 259 or .NET Standard.
1657+ yield " System.Runtime" // lots of types
1658+ yield " System.Linq" // System.Linq.Expressions.Expression<T>
1659+ yield " System.Reflection" // System.Reflection.ParameterInfo
1660+ yield " System.Linq.Expressions" // System.Linq.IQueryable<T>
1661+ yield " System.Threading.Tasks" // valuetype [System.Threading.Tasks]System.Threading.CancellationToken
1662+ yield " System.IO" // System.IO.TextWriter
1663+ //yield "System.Console" // System.Console.Out etc.
1664+ yield " System.Net.Requests" // System.Net.WebResponse etc.
1665+ yield " System.Collections" // System.Collections.Generic.List<T>
1666+ yield " System.Runtime.Numerics" // BigInteger
1667+ yield " System.Threading" // OperationCanceledException
1668+
1669+ #if ! TODO_ REWORK_ ASSEMBLY_ LOAD
16621670 yield " System.Web"
16631671 yield " System.Web.Services"
1664- yield " System.Windows.Forms" ]
1672+ yield " System.Windows.Forms"
1673+ #endif
1674+ ]
16651675
16661676// Extra implicit references for .NET 4.0
16671677let DefaultBasicReferencesForOutOfProjectSources40 =
@@ -2218,11 +2228,7 @@ type TcConfigBuilder =
22182228 resolutionAssemblyFoldersConditions = " "
22192229 platform = None
22202230 prefer32Bit = false
2221- #if ENABLE_ MONO_ SUPPORT
22222231 useSimpleResolution = runningOnMono
2223- #else
2224- useSimpleResolution = false
2225- #endif
22262232 target = ConsoleExe
22272233 debuginfo = false
22282234 testFlagEmitFeeFeeAs100001 = false
@@ -3655,8 +3661,8 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR
36553661 member __.GetRawFSharpSignatureData ( m , ilShortAssemName , filename ) =
36563662 let resources = ilModule.Resources.AsList
36573663 let sigDataReaders =
3658- [ for iresource in resources do
3659- if IsSignatureDataResource iresource then
3664+ [ for iresource in resources do
3665+ if IsSignatureDataResource iresource then
36603666 let ccuName = GetSignatureDataResourceName iresource
36613667 let byteReader = iresource.GetByteReader( m)
36623668 yield ( ccuName, byteReader()) ]
@@ -3665,9 +3671,9 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR
36653671 if List.contains ilShortAssemName externalSigAndOptData then
36663672 let sigFileName = Path.ChangeExtension( filename, " sigdata" )
36673673 if not sigDataReaders.IsEmpty then
3668- error( Error( FSComp.SR.buildDidNotExpectSigdataResource(), m))
3669- if not ( FileSystem.SafeExists sigFileName) then
3670- error( Error( FSComp.SR.buildExpectedSigdataFile( ), m))
3674+ error( Error( FSComp.SR.buildDidNotExpectSigdataResource( FileSystem.GetFullPathShim filename ), m))
3675+ if not ( FileSystem.SafeExists sigFileName) then
3676+ error( Error( FSComp.SR.buildExpectedSigdataFile ( FileSystem.GetFullPathShim sigFileName ), m))
36713677 [ ( ilShortAssemName, FileSystem.ReadAllBytesShim sigFileName)]
36723678 else
36733679 sigDataReaders
@@ -3682,9 +3688,9 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR
36823688 if List.contains ilShortAssemName externalSigAndOptData then
36833689 let optDataFile = Path.ChangeExtension( filename, " optdata" )
36843690 if not optDataReaders.IsEmpty then
3685- error( Error( FSComp.SR.buildDidNotExpectOptDataResource(), m))
3691+ error( Error( FSComp.SR.buildDidNotExpectOptDataResource( FileSystem.GetFullPathShim filename ), m))
36863692 if not ( FileSystem.SafeExists optDataFile) then
3687- error( Error( FSComp.SR.buildExpectedFileAlongSideFSharpCore( optDataFile), m))
3693+ error( Error( FSComp.SR.buildExpectedFileAlongSideFSharpCore( optDataFile, FileSystem.GetFullPathShim optDataFile ), m))
36883694 [ ( ilShortAssemName, ( fun () -> FileSystem.ReadAllBytesShim optDataFile))]
36893695 else
36903696 optDataReaders
@@ -5133,12 +5139,11 @@ let GetInitialTcEnv (thisAssemblyName:string, initm:range, tcConfig:TcConfig, tc
51335139
51345140 let tcEnv = CreateInitialTcEnv( tcGlobals, amap, initm, thisAssemblyName, ccus)
51355141
5136- let tcEnv =
5137- if tcConfig.checkOverflow then
5138- TcOpenDecl TcResultsSink.NoSink tcGlobals amap initm initm tcEnv ( pathToSynLid initm ( splitNamespace FSharpLib.CoreOperatorsCheckedName))
5139- else
5140- tcEnv
5141- tcEnv
5142+ if tcConfig.checkOverflow then
5143+ try TcOpenDecl TcResultsSink.NoSink tcGlobals amap initm initm tcEnv ( pathToSynLid initm ( splitNamespace FSharpLib.CoreOperatorsCheckedName))
5144+ with e -> errorRecovery e initm; tcEnv
5145+ else
5146+ tcEnv
51425147
51435148//----------------------------------------------------------------------------
51445149// Fault injection
@@ -5375,7 +5380,7 @@ let TypeCheckSingleInputAndFinishEventually(checkForErrors, tcConfig: TcConfig,
53755380 return TypeCheckMultipleInputsFinish([ results], tcState)
53765381 }
53775382
5378- let TypeCheckClosedInputSetFinish ( mimpls , tcState ) =
5383+ let TypeCheckClosedInputSetFinish ( declaredImpls : TypedImplFile list , tcState ) =
53795384 // Publish the latest contents to the CCU
53805385 tcState.tcsCcu.Deref.Contents <- tcState.tcsCcuType
53815386
@@ -5385,12 +5390,11 @@ let TypeCheckClosedInputSetFinish (mimpls, tcState) =
53855390 if not ( Zset.contains qualNameOfFile rootImpls) then
53865391 errorR( Error( FSComp.SR.buildSignatureWithoutImplementation( qualNameOfFile.Text), qualNameOfFile.Range)))
53875392
5388- let tassembly = TAssembly( mimpls)
5389- tcState, tassembly
5393+ tcState, declaredImpls
53905394
53915395let TypeCheckClosedInputSet ( checkForErrors , tcConfig , tcImports , tcGlobals , prefixPathOpt , tcState , inputs ) =
53925396 // tcEnvAtEndOfLastFile is the environment required by fsi.exe when incrementally adding definitions
53935397 let ( tcEnvAtEndOfLastFile , topAttrs , mimpls ), tcState = TypeCheckMultipleInputs ( checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, inputs)
5394- let tcState , tassembly = TypeCheckClosedInputSetFinish ( mimpls, tcState)
5395- tcState, topAttrs, tassembly , tcEnvAtEndOfLastFile
5398+ let tcState , declaredImpls = TypeCheckClosedInputSetFinish ( mimpls, tcState)
5399+ tcState, topAttrs, declaredImpls , tcEnvAtEndOfLastFile
53965400
0 commit comments