Enum in class is not working: lead.proto.fs(251, 13): [FS0001] No overloads match for method 'OfJson'.
- Dominant language
- F#
- Stars
- 144
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
Snippet like the below
```
enum SourceEnum {
FACEBOOK = 0;
OTHER = 1;
}
message Source {
/* Only used if the source_type = OTHER */
string other = 1;
SourceEnum source = 2;
}
```
generates code
```
[]
type Source =
{ mutable other : string option
mutable source : SourceEnum option }
static member JsonObjCodec =
(fun other source ->
{ other = other
source = source }) Operators.jopt ("other") (fun x -> x.other)
<*> Operators.jopt ("source") (fun x -> x.source)
```
which generates error
> lead.proto.fs(251, 13): [FS0001] No overloads match for method 'OfJson'. The available overloads are shown below.
Which seems to be referring to this line
> <*> Operators.jopt ("source") (fun x -> x.source)
as the problem
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.