@@ -484,44 +484,42 @@ module internal Impl =
484484#endif
485485 fields
486486
487- let getTupleConstructorMethod ( typ : Type , bindingFlags ) =
487+ let getTupleConstructorMethod ( typ : Type ) =
488488let ctor =
489489if typ.IsValueTypethen
490- let fields = typ.GetFields( bindingFlags ) |> orderTupleFields
490+ let fields = typ.GetFields( instanceFieldFlags ||| BindingFlags.Public ) |> orderTupleFields
491491#if FX_ RESHAPED_ REFLECTION
492- ignore bindingFlags
493492 typ.GetConstructor( fields|> Array.map( fun fi -> fi.FieldType))
494493#else
495- typ.GetConstructor( BindingFlags.Instance ||| bindingFlags , null , fields|> Array.map( fun fi -> fi.FieldType), null )
494+ typ.GetConstructor( BindingFlags.Public ||| BindingFlags.Instance , null , fields|> Array.map( fun fi -> fi.FieldType), null )
496495#endif
497496else
498497let props = typ.GetProperties() |> orderTupleProperties
499498#if FX_ RESHAPED_ REFLECTION
500- ignore bindingFlags
501499 typ.GetConstructor( props|> Array.map( fun p -> p.PropertyType))
502500#else
503- typ.GetConstructor( BindingFlags.Instance ||| bindingFlags , null , props|> Array.map( fun p -> p.PropertyType), null )
501+ typ.GetConstructor( BindingFlags.Public ||| BindingFlags.Instance , null , props|> Array.map( fun p -> p.PropertyType), null )
504502#endif
505503match ctorwith
506504| null -> raise<| ArgumentException( String.Format( SR.GetString( SR.invalidTupleTypeConstructorNotDefined), typ.FullName))
507505| _ -> ()
508506 ctor
509507
510- let getTupleCtor ( typ : Type , bindingFlags ) =
511- let ctor = getTupleConstructorMethod( typ, bindingFlags )
508+ let getTupleCtor ( typ : Type ) =
509+ let ctor = getTupleConstructorMethod typ
512510( fun ( args : obj []) ->
513511#if FX_ RESHAPED_ REFLECTION
514512 ctor.Invoke( args))
515513#else
516- ctor.Invoke( BindingFlags.InvokeMethod||| BindingFlags.Instance||| bindingFlags , null , args, null ))
514+ ctor.Invoke( BindingFlags.InvokeMethod||| BindingFlags.Instance||| BindingFlags.Public , null , args, null ))
517515#endif
518516
519517let rec getTupleReader ( typ : Type ) =
520518let etys = typ.GetGenericArguments()
521519// Get the reader for the outer tuple record
522520let reader =
523521if typ.IsValueTypethen
524- let fields = ( typ.GetFields( instanceFieldFlags||| BindingFlags.Public) |> orderTupleFields)
522+ let fields = ( typ.GetFields( instanceFieldFlags||| BindingFlags.Public) |> orderTupleFields)
525523(( fun ( obj : obj ) -> fields|> Array.map( fun field -> field.GetValue( obj))))
526524else
527525let props = ( typ.GetProperties( instancePropertyFlags||| BindingFlags.Public) |> orderTupleProperties)
@@ -538,7 +536,7 @@ module internal Impl =
538536
539537let rec getTupleConstructor ( typ : Type ) =
540538let etys = typ.GetGenericArguments()
541- let maker1 = getTupleCtor( typ, BindingFlags.Public )
539+ let maker1 = getTupleCtor typ
542540if etys.Length< maxTuple
543541then maker1
544542else
@@ -550,7 +548,7 @@ module internal Impl =
550548
551549let getTupleConstructorInfo ( typ : Type ) =
552550let etys = typ.GetGenericArguments()
553- let maker1 = getTupleConstructorMethod( typ, BindingFlags.Public )
551+ let maker1 = getTupleConstructorMethod typ
554552if etys.Length< maxTuplethen
555553 maker1, None
556554else