Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove fsharp.core.dll references to System.ValueTuple.dll, #4

Merged
merged 1 commit into from
Jul 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove fsharp.core.dll references to System.ValueTuple.dll, and remov…
…e FX_NOSTRUCTTUPLE now that dependency is reflection based.
KevinRansom committed Jul 6, 2016
commit 1cdeba6964aa50ca21d265b9a2e4f4c676f113d1
2 changes: 1 addition & 1 deletion src/FSharpSource.targets
Original file line number Diff line number Diff line change
@@ -288,7 +288,7 @@
<DefineConstants>$(DefineConstants);FX_NO_MISSINGMETHODEXCEPTION</DefineConstants>
<DefineConstants>$(DefineConstants);DONT_INCLUDE_DEPRECATED</DefineConstants>
<DefineConstants>$(DefineConstants);QUERIES_IN_FSLIB</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_STRUCTTUPLE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_ASSEMBLYLOADBYSTRING</DefineConstants>
<TargetFrameworkProfile>Profile47</TargetFrameworkProfile>
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.0</TargetFrameworkVersion>
</PropertyGroup>
4 changes: 0 additions & 4 deletions src/fsharp/FSharp.Core/FSharp.Core.fsproj
Original file line number Diff line number Diff line change
@@ -214,10 +214,6 @@
<Reference Include="System" />
<Reference Include="System.Numerics" Condition="'$(TargetFramework)' == 'net40'" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'portable47' and '$(TargetFramework)' != 'coreclr'">
<Reference Include="System.ValueTuple"><HintPath>..\..\..\packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1\System.ValueTuple.dll</HintPath></Reference>
<Reference Include="System.Runtime" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'coreclr'">
<None Include="project.json" />
</ItemGroup>
1 change: 0 additions & 1 deletion src/fsharp/FSharp.Core/project.json
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@
"System.Threading.Thread": "4.0.0",
"System.Threading.ThreadPool": "4.0.10",
"System.Threading.Timer": "4.0.1",
"System.ValueTuple": "4.0.0-rc3-24212-01",
},
"runtimes": {
"win7-x86": { },
12 changes: 4 additions & 8 deletions src/fsharp/FSharp.Core/reflect.fs
Original file line number Diff line number Diff line change
@@ -395,10 +395,13 @@ module internal Impl =

let mutable systemValueTupleException = null

#if !FX_NO_STRUCTTUPLE
let reflectedValueTuple n =
try
#if FX_ASSEMBLYLOADBYSTRING
let a = Assembly.Load("System.ValueTuple")
#else
let a = Assembly.Load(new AssemblyName("System.ValueTuple"))
#endif
match n with
| 1 -> Some (a.GetType("System.ValueTuple`1"))
| 2 -> Some (a.GetType("System.ValueTuple`2"))
@@ -446,7 +449,6 @@ module internal Impl =
let isStructTuple6Type typ = structTupleEquivHeadTypes typ stuple6
let isStructTuple7Type typ = structTupleEquivHeadTypes typ stuple7
let isStructTuple8Type typ = structTupleEquivHeadTypes typ stuple8
#endif

let isTupleType typ =
let isRefTupleType =
@@ -460,9 +462,6 @@ module internal Impl =
|| isTuple8Type typ

let isStructTupleType =
#if FX_NO_STRUCTTUPLE
false
#else
// If we can't load the System.ValueTuple Assembly then it can't be a struct tuple
try
isStructTuple1Type typ
@@ -474,15 +473,13 @@ module internal Impl =
|| isStructTuple7Type typ
|| isStructTuple8Type typ
with | :? System.IO.FileNotFoundException -> false
#endif
isRefTupleType || isStructTupleType

let maxTuple = 8
// Which field holds the nested tuple?
let tupleEncField = maxTuple-1

let rec mkTupleType isStruct (tys: Type[]) =
#if !FX_NO_STRUCTTUPLE
let deOption (o: option<Type>) =
match o with
| Some v -> v
@@ -503,7 +500,6 @@ module internal Impl =
deOption(stuple8).MakeGenericType(Array.append tysA [| tyB |])
| _ -> invalidArg "tys" (SR.GetString(SR.invalidTupleTypes))
else
#endif
match tys.Length with
| 1 -> tuple1.MakeGenericType(tys)
| 2 -> tuple2.MakeGenericType(tys)