Reputation: 3224
MS documentation: Use interfaces to group related operations
type Serializer =
abstract Serialize<'T>: preserveRefEq: bool -> value: 'T -> string
abstract Deserialize<'T>: preserveRefEq: bool -> pickle: string -> 'T
If I copy and paste that into an fsx
script or a dotnet-interactive
notebook, I'll get a compiler error that says:
This construct is deprecated: ':' is not permitted as a character in operator names and is reserved for future useF# Compiler(35)
What changes would I need to make in order to fix this example?
Upvotes: 1
Views: 43
Reputation: 1721
I think just adding a space before the colon fixes it:
type Serializer =
abstract Serialize<'T> : preserveRefEq: bool -> value: 'T -> string
abstract Deserialize<'T> : preserveRefEq: bool -> pickle: string -> 'T
This might be a compiler bug.
Upvotes: 3