-
Notifications
You must be signed in to change notification settings - Fork 842
Closed
Description
I noticed an interesting behaviour while attempting to port FsPickler to .NET standard. By default F# will add the serializable flag to all types unless declared otherwise (via the AutoSerializableAttribute). It seems that in the netstandard1.6 build of the FSharp.Core nuget many types seem to be lacking the serializable flag. This includes types like
- F# options, lists, choice, etc
Microsoft.FSharp.Control.FSharpAsyncMicrosoft.FSharp.Quotations.FSharpExprMicrosoft.FSharp.Core.OptimizedClosures+Invoke@3253Microsoft.FSharp.Core.ExtraTopLevelOperators+dictValueType@98
which are serializable in the net45 build of the same nuget package version (4.2.3).
Repro steps
- Create and run a nestandard2.0 console application with the following code
[<EntryPoint>]
let main argv =
printfn "%b" typeof<int option>.IsSerializable
0Expected behavior
Should print true to console.
Actual behavior
Prints false to console.
Related information
This issue doesn't seem to affect user-defined F# types. For instance the following program
type Foo = class end
[<EntryPoint>]
let main argv =
printfn "%b" typeof<Foo>.IsSerializable
0will print true for a netcoreapp2.0 application. The same holds for types defined in F# netstandard2.0 types.
Metadata
Metadata
Assignees
Labels
No labels