@@ -869,11 +869,9 @@ module MainModuleBuilder =
869869 error( Error( FSComp.SR.fscAssemblyCultureAttributeError(), rangeCmdArgs))
870870
871871 // Add the type forwarders to any .NET DLL post-.NET-2.0, to give binary compatibility
872- let exportedTypesList =
873- if ( tcConfig.compilingFslib && tcConfig.compilingFslib40) then
874- ( List.append ( createMscorlibExportList tcGlobals)
875- ( if tcConfig.compilingFslibNoBigInt then [] else ( createSystemNumericsExportList tcConfig tcImports))
876- )
872+ let exportedTypesList =
873+ if tcConfig.compilingFslib then
874+ List.append ( createMscorlibExportList tcGlobals) ( createSystemNumericsExportList tcConfig tcImports)
877875 else
878876 []
879877
@@ -1279,64 +1277,6 @@ module StaticLinker =
12791277
12801278 ilxMainModule, rewriteExternalRefsToLocalRefs
12811279
1282-
1283- // LEGACY: This is only used when compiling an FSharp.Core for .NET 2.0 (FSharp.Core 2.3.0.0). We no longer
1284- // build new FSharp.Core for that configuration.
1285- //
1286- // Find all IL modules that are to be statically linked given the static linking roots.
1287- let LegacyFindAndAddMscorlibTypesForStaticLinkingIntoFSharpCoreLibraryForNet20 ( tcConfig : TcConfig , ilGlobals : ILGlobals , ilxMainModule ) =
1288- let mscorlib40 = tcConfig.compilingFslib20.Value
1289-
1290- let ilBinaryReader =
1291- let ilGlobals = mkILGlobals ILScopeRef.Local
1292- let opts : ILReaderOptions =
1293- { ilGlobals = ilGlobals
1294- reduceMemoryUsage = tcConfig.reduceMemoryUsage
1295- metadataOnly = MetadataOnlyFlag.No
1296- tryGetMetadataSnapshot = ( fun _ -> None)
1297- pdbDirPath = None }
1298- ILBinaryReader.OpenILModuleReader mscorlib40 opts
1299-
1300- let tdefs1 = ilxMainModule.TypeDefs.AsList |> List.filter ( fun td -> not ( MainModuleBuilder.injectedCompatTypes.Contains( td.Name)))
1301- let tdefs2 = ilBinaryReader.ILModuleDef.TypeDefs.AsList |> List.filter ( fun td -> MainModuleBuilder.injectedCompatTypes.Contains( td.Name))
1302- //printfn "tdefs2 = %A" (tdefs2 |> List.map (fun tdef -> tdef.Name))
1303-
1304- // rewrite the mscorlib references
1305- let tdefs2 =
1306- let fakeModule = mkILSimpleModule " " " " true ( 4 , 0 ) false ( mkILTypeDefs tdefs2) None None 0 ( mkILExportedTypes []) " "
1307- let fakeModule =
1308- fakeModule |> Morphs.morphILTypeRefsInILModuleMemoized ilGlobals ( fun tref ->
1309- if MainModuleBuilder.injectedCompatTypes.Contains( tref.Name) || ( tref.Enclosing |> List.exists ( fun x -> MainModuleBuilder.injectedCompatTypes.Contains x)) then
1310- tref
1311- //|> Morphs.morphILScopeRefsInILTypeRef (function ILScopeRef.Local -> ilGlobals.mscorlibScopeRef | x -> x)
1312- // The implementations of Tuple use two private methods from System.Environment to get a resource string. Remap it
1313- elif tref.Name = " System.Environment" then
1314- ILTypeRef.Create( ILScopeRef.Local, [], " Microsoft.FSharp.Core.PrivateEnvironment" ) //|> Morphs.morphILScopeRefsInILTypeRef (function ILScopeRef.Local -> ilGlobals.mscorlibScopeRef | x -> x)
1315- else
1316- tref |> Morphs.morphILScopeRefsInILTypeRef ( fun _ -> ilGlobals.primaryAssemblyScopeRef) )
1317-
1318- // strip out System.Runtime.TargetedPatchingOptOutAttribute, which doesn't exist for 2.0
1319- let fakeModule =
1320- { fakeModule with
1321- TypeDefs =
1322- mkILTypeDefs
1323- ([ for td in fakeModule.TypeDefs do
1324- let meths = td.Methods.AsList
1325- |> List.map ( fun md ->
1326- md.With( customAttrs =
1327- mkILCustomAttrs ( td.CustomAttrs.AsList |> List.filter ( fun ilattr ->
1328- ilattr.Method.DeclaringType.TypeRef.FullName <> " System.Runtime.TargetedPatchingOptOutAttribute" ))))
1329- |> mkILMethods
1330- let td = td.With( methods= meths)
1331- yield td.With( methods= meths) ])}
1332- //ILAsciiWriter.output_module stdout fakeModule
1333- fakeModule.TypeDefs.AsList
1334-
1335- let ilxMainModule =
1336- { ilxMainModule with
1337- TypeDefs = mkILTypeDefs ( tdefs1 @ tdefs2) }
1338- ilxMainModule
1339-
13401280 [<NoEquality; NoComparison>]
13411281 type Node =
13421282 { name: string
@@ -1481,7 +1421,7 @@ module StaticLinker =
14811421 let StaticLink ( ctok , tcConfig : TcConfig , tcImports : TcImports , ilGlobals : ILGlobals ) =
14821422
14831423#if ! NO_ EXTENSIONTYPING
1484- let providerGeneratedAssemblies =
1424+ let providerGeneratedAssemblies =
14851425
14861426 [ // Add all EST-generated assemblies into the static linking set
14871427 for KeyValue(_, importedBinary: ImportedBinary) in tcImports.DllTable do
@@ -1490,10 +1430,7 @@ module StaticLinker =
14901430 | None -> ()
14911431 | Some provAssemStaticLinkInfo -> yield ( importedBinary, provAssemStaticLinkInfo) ]
14921432#endif
1493- if tcConfig.compilingFslib && tcConfig.compilingFslib20.IsSome then
1494- ( fun ilxMainModule -> LegacyFindAndAddMscorlibTypesForStaticLinkingIntoFSharpCoreLibraryForNet20 ( tcConfig, ilGlobals, ilxMainModule))
1495-
1496- elif not tcConfig.standalone && tcConfig.extraStaticLinkRoots.IsEmpty
1433+ if not tcConfig.standalone && tcConfig.extraStaticLinkRoots.IsEmpty
14971434#if ! NO_ EXTENSIONTYPING
14981435 && providerGeneratedAssemblies.IsEmpty
14991436#endif
0 commit comments