I tried to dig a bit into this and it appears that you have discovered a bug in FsCheck.
It appears that the problem is in file Arbitrary.fs and is really only string-related. I had to replace this, where they call ToCharArray on the string
static member String() =
{ new Arbitrary<string>() with
override x.Generator = Gen.map (fun chars -> new String(List.toArray chars)) generate
override x.Shrinker s = s.ToCharArray() |> Array.toList |> shrink |> Seq.map (fun chars -> new String(List.toArray chars))
}
with this
static member String() =
{ new Arbitrary<string>() with
override x.Generator = Gen.map (fun chars -> new String(List.toArray chars)) generate
override x.Shrinker s =
match s with
| null -> seq {yield null;}
| _ -> s.ToCharArray() |> Array.toList |> shrink |> Seq.map (fun chars -> new String(List.toArray chars))
}
You may want to raise this with fscheck developers here and also check if my fix works well - there is probably a better way to implement it, but it would be simpler for someone, who already knows the code.