Skip to content

Commit

Permalink
reflect
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinRansom committed May 24, 2019
1 parent 7a2dfcc commit 373fae6
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/fsharp/FSharp.Core/reflect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,7 @@ module internal Impl =

let getRecordConstructorMethod(typ: Type, bindingFlags) =
let props = fieldPropsOfRecordType(typ, bindingFlags)
#if FX_RESHAPED_REFLECTION
let ctor = typ.GetConstructor(props |> Array.map (fun p -> p.PropertyType))
#else
let ctor = typ.GetConstructor(BindingFlags.Instance ||| bindingFlags, null, props |> Array.map (fun p -> p.PropertyType), null)
#endif
match ctor with
| null -> raise <| ArgumentException (String.Format (SR.GetString (SR.invalidRecordTypeConstructorNotDefined), typ.FullName))
| _ -> ()
Expand All @@ -644,11 +640,7 @@ module internal Impl =
let getRecordConstructor(typ: Type, bindingFlags) =
let ctor = getRecordConstructorMethod(typ, bindingFlags)
(fun (args: obj[]) ->
#if FX_RESHAPED_REFLECTION
ctor.Invoke args)
#else
ctor.Invoke(BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| bindingFlags, null, args, null))
#endif

/// EXCEPTION DECOMPILATION
// Check the base type - if it is also an F# type then
Expand Down

0 comments on commit 373fae6

Please sign in to comment.