@@ -78,11 +78,13 @@ module internal Impl =
78
78
//-----------------------------------------------------------------
79
79
// GENERAL UTILITIES
80
80
#if FX_ ATLEAST_ PORTABLE
81
+ let instanceFieldFlags = BindingFlags.Instance
81
82
let instancePropertyFlags = BindingFlags.Instance
82
83
let staticPropertyFlags = BindingFlags.Static
83
84
let staticFieldFlags = BindingFlags.Static
84
85
let staticMethodFlags = BindingFlags.Static
85
86
#else
87
+ let instanceFieldFlags = BindingFlags.GetField ||| BindingFlags.Instance
86
88
let instancePropertyFlags = BindingFlags.GetProperty ||| BindingFlags.Instance
87
89
let staticPropertyFlags = BindingFlags.GetProperty ||| BindingFlags.Static
88
90
let staticFieldFlags = BindingFlags.GetField ||| BindingFlags.Static
@@ -385,7 +387,8 @@ module internal Impl =
385
387
386
388
let isTupleType ( typ : Type ) =
387
389
// Simple Name Match on typ
388
- tupleNames |> Seq.exists( fun n -> typ.FullName.StartsWith( n))
390
+ if typ.IsEnum || typ.IsArray || typ.IsPointer then false
391
+ else tupleNames |> Seq.exists( fun n -> typ.FullName.StartsWith( n))
389
392
390
393
let maxTuple = 8
391
394
// Which field holds the nested tuple?
@@ -470,7 +473,7 @@ module internal Impl =
470
473
elif j= maxTuple then " Rest"
471
474
else ( assert false ; " " )) // dead code under prior assert, props.Length <= maxTuple
472
475
haveNames = expectNames)
473
- #endif
476
+ #endif
474
477
props
475
478
476
479
let orderTupleFields ( fields : FieldInfo []) =
@@ -534,7 +537,7 @@ module internal Impl =
534
537
// Get the reader for the outer tuple record
535
538
let reader =
536
539
if typ.IsValueType then
537
- let fields = ( typ.GetFields( instancePropertyFlags ||| BindingFlags.Public) |> orderTupleFields)
540
+ let fields = ( typ.GetFields( instanceFieldFlags ||| BindingFlags.Public) |> orderTupleFields)
538
541
(( fun ( obj : obj ) -> fields |> Array.map ( fun field -> field.GetValue( obj))))
539
542
else
540
543
let props = ( typ.GetProperties( instancePropertyFlags ||| BindingFlags.Public) |> orderTupleProperties)
0 commit comments