@@ -1640,28 +1640,38 @@ let DefaultBasicReferencesForOutOfProjectSources40 = []
1640
1640
1641
1641
#else
1642
1642
let DefaultBasicReferencesForOutOfProjectSources =
1643
- [ yield " System"
1643
+ [ // These are .NET-Framework -style references
1644
+ #if ! TODO_ REWORK_ ASSEMBLY_ LOAD
1645
+ yield " System"
1644
1646
yield " System.Xml"
1645
1647
yield " System.Runtime.Remoting"
1646
1648
yield " System.Runtime.Serialization.Formatters.Soap"
1647
1649
yield " System.Data"
1648
1650
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
1660
1653
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
1662
1670
yield " System.Web"
1663
1671
yield " System.Web.Services"
1664
- yield " System.Windows.Forms" ]
1672
+ yield " System.Windows.Forms"
1673
+ #endif
1674
+ ]
1665
1675
1666
1676
// Extra implicit references for .NET 4.0
1667
1677
let DefaultBasicReferencesForOutOfProjectSources40 =
@@ -2218,11 +2228,7 @@ type TcConfigBuilder =
2218
2228
resolutionAssemblyFoldersConditions = " "
2219
2229
platform = None
2220
2230
prefer32Bit = false
2221
- #if ENABLE_ MONO_ SUPPORT
2222
2231
useSimpleResolution = runningOnMono
2223
- #else
2224
- useSimpleResolution = false
2225
- #endif
2226
2232
target = ConsoleExe
2227
2233
debuginfo = false
2228
2234
testFlagEmitFeeFeeAs100001 = false
@@ -3655,8 +3661,8 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR
3655
3661
member __.GetRawFSharpSignatureData ( m , ilShortAssemName , filename ) =
3656
3662
let resources = ilModule.Resources.AsList
3657
3663
let sigDataReaders =
3658
- [ for iresource in resources do
3659
- if IsSignatureDataResource iresource then
3664
+ [ for iresource in resources do
3665
+ if IsSignatureDataResource iresource then
3660
3666
let ccuName = GetSignatureDataResourceName iresource
3661
3667
let byteReader = iresource.GetByteReader( m)
3662
3668
yield ( ccuName, byteReader()) ]
@@ -3665,9 +3671,9 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR
3665
3671
if List.contains ilShortAssemName externalSigAndOptData then
3666
3672
let sigFileName = Path.ChangeExtension( filename, " sigdata" )
3667
3673
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))
3671
3677
[ ( ilShortAssemName, FileSystem.ReadAllBytesShim sigFileName)]
3672
3678
else
3673
3679
sigDataReaders
@@ -3682,9 +3688,9 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR
3682
3688
if List.contains ilShortAssemName externalSigAndOptData then
3683
3689
let optDataFile = Path.ChangeExtension( filename, " optdata" )
3684
3690
if not optDataReaders.IsEmpty then
3685
- error( Error( FSComp.SR.buildDidNotExpectOptDataResource(), m))
3691
+ error( Error( FSComp.SR.buildDidNotExpectOptDataResource( FileSystem.GetFullPathShim filename ), m))
3686
3692
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))
3688
3694
[ ( ilShortAssemName, ( fun () -> FileSystem.ReadAllBytesShim optDataFile))]
3689
3695
else
3690
3696
optDataReaders
@@ -5133,12 +5139,11 @@ let GetInitialTcEnv (thisAssemblyName:string, initm:range, tcConfig:TcConfig, tc
5133
5139
5134
5140
let tcEnv = CreateInitialTcEnv( tcGlobals, amap, initm, thisAssemblyName, ccus)
5135
5141
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
5142
5147
5143
5148
//----------------------------------------------------------------------------
5144
5149
// Fault injection
@@ -5375,7 +5380,7 @@ let TypeCheckSingleInputAndFinishEventually(checkForErrors, tcConfig: TcConfig,
5375
5380
return TypeCheckMultipleInputsFinish([ results], tcState)
5376
5381
}
5377
5382
5378
- let TypeCheckClosedInputSetFinish ( mimpls , tcState ) =
5383
+ let TypeCheckClosedInputSetFinish ( declaredImpls : TypedImplFile list , tcState ) =
5379
5384
// Publish the latest contents to the CCU
5380
5385
tcState.tcsCcu.Deref.Contents <- tcState.tcsCcuType
5381
5386
@@ -5385,12 +5390,11 @@ let TypeCheckClosedInputSetFinish (mimpls, tcState) =
5385
5390
if not ( Zset.contains qualNameOfFile rootImpls) then
5386
5391
errorR( Error( FSComp.SR.buildSignatureWithoutImplementation( qualNameOfFile.Text), qualNameOfFile.Range)))
5387
5392
5388
- let tassembly = TAssembly( mimpls)
5389
- tcState, tassembly
5393
+ tcState, declaredImpls
5390
5394
5391
5395
let TypeCheckClosedInputSet ( checkForErrors , tcConfig , tcImports , tcGlobals , prefixPathOpt , tcState , inputs ) =
5392
5396
// tcEnvAtEndOfLastFile is the environment required by fsi.exe when incrementally adding definitions
5393
5397
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
5396
5400
0 commit comments