Skip to content

Commit 62e5dd8

Browse files
KevinRansombaronfel
authored andcommitted
relax multiple load objection (#7613)
1 parent d12b732 commit 62e5dd8

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/fsharp/CompileOps.fs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2572,17 +2572,13 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
25722572
let filename = ComputeMakePathAbsolute data.implicitIncludeDir r.Text
25732573
if FileSystem.SafeExists filename then
25742574
r, Some filename
2575-
else
2575+
else
25762576
// If the file doesn't exist, let reference resolution logic report the error later...
25772577
defaultCoreLibraryReference, if Range.equals r.Range rangeStartup then Some(filename) else None
25782578
match data.referencedDLLs |> List.filter (fun assemblyReference -> assemblyReference.SimpleAssemblyNameIs libraryName) with
2579-
| [r] -> nameOfDll r
2580-
| [] ->
2581-
defaultCoreLibraryReference, None
2582-
| r :: _ ->
2583-
// Recover by picking the first one.
2584-
errorR(Error(FSComp.SR.buildMultipleReferencesNotAllowed libraryName, rangeCmdArgs))
2585-
nameOfDll r
2579+
| [] -> defaultCoreLibraryReference, None
2580+
| [r]
2581+
| r :: _ -> nameOfDll r
25862582

25872583
// Look for an explicit reference to mscorlib/netstandard.dll or System.Runtime.dll and use that to compute clrRoot and targetFrameworkVersion
25882584
let primaryAssemblyReference, primaryAssemblyExplicitFilenameOpt = computeKnownDllReference(data.primaryAssembly.Name)

src/fsharp/FSComp.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ buildProductNameCommunity,"F# Compiler for F# %s"
4343
212,buildInvalidFilename,"'%s' is not a valid filename"
4444
213,buildInvalidAssemblyName,"'%s' is not a valid assembly name"
4545
214,buildInvalidPrivacy,"Unrecognized privacy setting '%s' for managed resource, valid options are 'public' and 'private'"
46-
215,buildMultipleReferencesNotAllowed,"Multiple references to '%s.dll' are not permitted"
4746
218,buildCannotReadAssembly,"Unable to read assembly '%s'"
4847
220,buildAssemblyResolutionFailed,"Assembly resolution failure at or near this location"
4948
221,buildImplicitModuleIsNotLegalIdentifier,"The declarations in this file will be placed in an implicit module '%s' based on the file name '%s'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file."

0 commit comments

Comments
 (0)