Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Pickle a list of DayOfWeek #110

Open
davidtme opened this issue Nov 20, 2018 · 1 comment
Open

Can't Pickle a list of DayOfWeek #110

davidtme opened this issue Nov 20, 2018 · 1 comment

Comments

@davidtme
Copy link

A List of DayOfWeek throws an exception

#r "FsPickler.dll"
open MBrace.FsPickler

let binarySerializer = FsPickler.CreateBinarySerializer()
let pickle = binarySerializer.Pickle [System.DayOfWeek.Monday]

Error:

MBrace.FsPickler.FsPicklerException
  HResult=0x80131500
  Message=Error serializing object of type 'Microsoft.FSharp.Collections.FSharpList`1[System.DayOfWeek]'.
  Source=FsPickler
  StackTrace:
   at MBrace.FsPickler.RootSerialization.writeRootObject[T](IPicklerResolver resolver, ReflectionCache reflectionCache, IPickleFormatWriter formatter, FSharpOption`1 streamingContext, FSharpOption`1 sifter, Boolean isHash, Boolean disableSubtypes, Pickler`1 pickler, T value)
   at MBrace.FsPickler.FsPicklerSerializer.Serialize[T](Stream stream, T value, FSharpOption`1 pickler, FSharpOption`1 streamingContext, FSharpOption`1 encoding, FSharpOption`1 leaveOpen)
   at <StartupCode$FsPickler>.$Serializer.Pickle@155.Invoke(T v)
   at MBrace.FsPickler.FsPicklerSerializer.Pickle[T](T value, FSharpOption`1 pickler, FSharpOption`1 streamingContext, FSharpOption`1 encoding)

Inner Exception 1:
ArgumentException: Object must be an array of primitives.
Parameter name: src

An array of DayOfWeek works fine

@ingted
Copy link

ingted commented Mar 29, 2022

The new version should be fine.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants