Skip to content

Commit

Permalink
Add type annotations to avoid inferred #seq causing problems during R…
Browse files Browse the repository at this point in the history
…elease builds.
  • Loading branch information
kurtschelfthout committed Aug 30, 2021
1 parent 331fde8 commit d37e733
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/FsCheck/ReflectArbitrary.fs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ module internal ReflectArbitrary =
else
fun _ -> []

let private reflectShrinkObj getShrink o (t:Type) =
let private reflectShrinkObj (getShrink:Type->obj->seq<obj>) o (t:Type) =
//assumes that l contains at least one element.
let split3 l =
let rec split3' front m back =
Expand Down Expand Up @@ -311,4 +311,4 @@ module internal ReflectArbitrary =
else
Seq.empty

let reflectShrink getShrink (a:'a) = reflectShrinkObj getShrink a (typeof<'a>) |> Seq.map (unbox<'a>)
let reflectShrink<'T> (getShrink: Type -> obj -> seq<obj>) (a:'T) = reflectShrinkObj getShrink a (typeof<'T>) |> Seq.map (unbox<'T>)
4 changes: 2 additions & 2 deletions src/FsCheck/TypeClass.fs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ module TypeClass =
Array <| arr
| prim -> Primitive prim

let private getMethods (t: Type) =
let private getMethods (t: Type) : seq<MethodInfo> =
#if NETSTANDARD1_0
t.GetRuntimeMethods()
#else
t.GetMethods(BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.FlattenHierarchy ||| BindingFlags.NonPublic ||| BindingFlags.Instance)
upcast t.GetMethods(BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.FlattenHierarchy ||| BindingFlags.NonPublic ||| BindingFlags.Instance)
#endif

//returns a dictionary of generic types to methodinfo, a catch all, and array types in a list by rank
Expand Down

0 comments on commit d37e733

Please sign in to comment.