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

Commitba1e562

Browse files
authored
Merge pull request #3897 from KevinRansom/valuetuplefix
Fix System.ValueTuple on net 4.7.1 ---- issue 3896
2 parentsc0b044c +54dd973 commitba1e562

File tree

6 files changed

+45
-20
lines changed

6 files changed

+45
-20
lines changed

‎src/fsharp/CompileOps.fs‎

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,20 +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
17781778

1779-
// If necessary assume a reference to the latest System.ValueTuple with which those tools are built.
1780-
letGetDefaultSystemValueTupleReference()=
1781-
#if COMPILER_SERVICE_AS_DLL
1782-
None// TODO, right now FCS doesn't add this reference automatically
1783-
#else
1784-
try
1785-
letasm= typeof<System.ValueTuple<int, int>>.Assembly
1786-
if asm.FullName.StartsWith"System.ValueTuple"then
1787-
Some asm.Location
1788-
else None
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
17891795
with_-> None
1790-
#endif
17911796

17921797
letGetFsiLibraryName()="FSharp.Compiler.Interactive.Settings"
17931798

@@ -1821,10 +1826,11 @@ let DefaultReferencesForScriptsAndOutOfProjectSources(assumeDotNetFramework) =
18211826
yield"System.Collections"// System.Collections.Generic.List<T>
18221827
yield"System.Runtime.Numerics"// BigInteger
18231828
yield"System.Threading"// OperationCanceledException
1824-
// always include a default reference to System.ValueTuple.dll in scripts and out-of-project sources
1825-
match GetDefaultSystemValueTupleReference()with
1826-
| None->()
1827-
| Some v->yield v
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
18281834

18291835
yield"System.Web"
18301836
yield"System.Web.Services"

‎tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
<Project>{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}</Project>
5050
<Name>FSharp.Compiler.Private</Name>
5151
</ProjectReference>
52+
<ReferenceInclude="System.ValueTuple">
53+
<HintPath>$(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
54+
<Private>true</Private>
55+
</Reference>
5256
</ItemGroup>
5357

5458
<ImportProject="$(FSharpSourcesRoot)\FSharpSource.targets" />

‎tests/service/ProjectOptionsTests.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,13 +485,12 @@ let ``Test OtherOptions order for GetProjectOptionsFromScript`` () =
485485
letscriptPath=__SOURCE_DIRECTORY__+@"/data/ScriptProject/"+ scriptName+".fsx"
486486
letscriptSource= File.ReadAllText scriptPath
487487
letprojOpts,_diagnostics= checker.GetProjectOptionsFromScript(scriptPath, scriptSource)|> Async.RunSynchronously
488-
489488
projOpts.OtherOptions
490489
|> Array.map(fun s->if s.StartsWith"--"then selse Path.GetFileNameWithoutExtension s)
491490
|> Array.forall(fun s-> Set.contains s expected2)
492491
|> shouldEqualtrue
493492

494-
letotherArgs=[|"--noframework";"--warn:3";"System.Numerics";"mscorlib";"FSharp.Core";"System";"System.Xml";"System.Runtime.Remoting";"System.Runtime.Serialization.Formatters.Soap";"System.Data";"System.Drawing";"System.Core";"System.Runtime";"System.Linq";"System.Reflection";"System.Linq.Expressions";"System.Threading.Tasks";"System.IO";"System.Net.Requests";"System.Collections";"System.Runtime.Numerics";"System.Threading";"System.Web";"System.Web.Services";"System.Windows.Forms";"FSharp.Compiler.Interactive.Settings"|]|> Set.ofArray
493+
letotherArgs=[|"--noframework";"--warn:3";"System.Numerics";"System.ValueTuple";"mscorlib";"FSharp.Core";"System";"System.Xml";"System.Runtime.Remoting";"System.Runtime.Serialization.Formatters.Soap";"System.Data";"System.Drawing";"System.Core";"System.Runtime";"System.Linq";"System.Reflection";"System.Linq.Expressions";"System.Threading.Tasks";"System.IO";"System.Net.Requests";"System.Collections";"System.Runtime.Numerics";"System.Threading";"System.Web";"System.Web.Services";"System.Windows.Forms";"FSharp.Compiler.Interactive.Settings"|]|> Set.ofArray
495494

496495
test"Main1" otherArgs
497496
test"Main2" otherArgs

‎vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@
7171
<Name>FSharp.Compiler.Private</Name>
7272
<Private>True</Private>
7373
</ProjectReference>
74-
</ItemGroup>
74+
<ReferenceInclude="System.ValueTuple">
75+
<HintPath>$(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
76+
<Private>true</Private>
77+
</Reference>
78+
</ItemGroup>
7579
<ImportProject="$(FSharpSourcesRoot)\FSharpSource.targets" />
7680
</Project>

‎vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@
162162
<Private>True</Private>
163163
<HintPath>$(NUnitLibDir)\nunit.framework.dll</HintPath>
164164
</Reference>
165+
<ReferenceInclude="System.ValueTuple">
166+
<HintPath>$(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
167+
<Private>true</Private>
168+
</Reference>
165169
<ProjectReferenceInclude="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
166170
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
167171
<Name>FSharp.Core</Name>

‎vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@
341341
<HintPath>$(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
342342
<Private>True</Private>
343343
</Reference>
344+
<ReferenceInclude="System.ValueTuple">
345+
<HintPath>$(FSharpSourcesRoot)\..\packages\System.ValueTuple.1.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
346+
<Private>True</Private>
347+
</Reference>
344348
<ProjectReferenceInclude="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
345349
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
346350
<Name>FSharp.Core</Name>
@@ -360,7 +364,11 @@
360364
<Name>FSharp.Compiler.Private</Name>
361365
<Private>True</Private>
362366
</ProjectReference>
363-
<ProjectReferenceInclude="..\Salsa\VisualFSharp.Salsa.fsproj">
367+
<ReferenceInclude="System.ValueTuple">
368+
<HintPath>$(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
369+
<Private>true</Private>
370+
</Reference>
371+
<ProjectReferenceInclude="..\Salsa\VisualFSharp.Salsa.fsproj">
364372
<Name>VisualFSharp.Salsa</Name>
365373
<Project>{fbd4b354-dc6e-4032-8ec7-c81d8dfb1af7}</Project>
366374
<Private>True</Private>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp