Given the following code:
open System
[<DefaultAugmentation(false)>]
type Option<'T> =
| Some of Value: 'T
| None
member x.Value =
match x with
| Some x -> x
| None -> raise (new InvalidOperationException("Option.Value"))
static member None : Option<'T> = None
and 'T option = Option<'T>
When compiling or pasted to FSI, produces the following issue:
Error in pass2 for type ..., error: duplicate entry 'get_None' in method table
Removing DefaultAugmentation attribute and static member None resolves the issue.
Interestingly enough, this is roughly how FSharpOption is defined in fslib, it also fails to compile in fsi, but not in product compiler apparently.
If it's a regression, then it's a fairly old one, SharpLab shows it and they use F# 6
Given the following code:
When compiling or pasted to FSI, produces the following issue:
Removing
DefaultAugmentationattribute and static memberNoneresolves the issue.Interestingly enough, this is roughly how
FSharpOptionis defined in fslib, it also fails to compile in fsi, but not in product compiler apparently.If it's a regression, then it's a fairly old one, SharpLab shows it and they use F# 6