Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd63f873

Browse files
committed
Hosted compiler sets an alternate directory
1 parentc212e96 commitd63f873

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

‎src/fsharp/CompileOps.fs‎

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,25 @@ let OutputDiagnosticContext prefix fileLineFn os err =
17741774
letGetFSharpCoreLibraryName()="FSharp.Core"
17751775

17761776
// If necessary assume a reference to the latest .NET Framework FSharp.Core with which those tools are built.
1777-
letGetDefaultFSharpCoreReference()= typeof<list<int>>.Assembly.Location
1777+
letGetDefaultFSharpCoreReference()= typeof<list<int>>.Assembly.Location
1778+
1779+
typeprivateTypeInThisAssembly=classend
1780+
1781+
// Use the ValueTuple that is executing with the compiler if it is from System.ValueTuple
1782+
// or the System.ValueTuple.dll that sits alongside the compiler. (Note we always ship one with the compiler)
1783+
letGetDefaultSystemValueTupleReference()=
1784+
try
1785+
letasm= typeof<System.ValueTuple<int, int>>.Assembly
1786+
if asm.FullName.StartsWith"System.ValueTuple"then
1787+
Some asm.Location
1788+
else
1789+
letlocation= Path.GetDirectoryName(typeof<TypeInThisAssembly>.Assembly.Location)
1790+
letvalueTuplePath= Path.Combine(location,"System.ValueTuple.dll")
1791+
if File.Exists(valueTuplePath)then
1792+
Some valueTuplePath
1793+
else
1794+
None
1795+
with_-> None
17781796

17791797
letGetFsiLibraryName()="FSharp.Compiler.Interactive.Settings"
17801798

@@ -1808,10 +1826,11 @@ let DefaultReferencesForScriptsAndOutOfProjectSources(assumeDotNetFramework) =
18081826
yield"System.Collections"// System.Collections.Generic.List<T>
18091827
yield"System.Runtime.Numerics"// BigInteger
18101828
yield"System.Threading"// OperationCanceledException
1811-
#if!COMPILER_SERVICE_AS_DLL
1812-
// TODO, right now FCS doesn't add this reference automatically
1813-
yield"System.ValueTuple"
1814-
#endif
1829+
1830+
// always include a default reference to System.ValueTuple.dll in scripts and out-of-project sources
1831+
match GetDefaultSystemValueTupleReference()with
1832+
| None->()
1833+
| Some v->yield v
18151834

18161835
yield"System.Web"
18171836
yield"System.Web.Services"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp