Description
When a static field has the [<FSharp.Core.DefaultValue>] attribute, Fable leaves its value as undefined, which can have different behavior than the .NET default value.
Repro code
type Foo() =
[<FSharp.Core.DefaultValue>]
static val mutable private count : int
static member IncrCount() =
Foo.count <- Foo.count + 1
Foo.count
printfn "%d" (Foo.IncrCount())
Expected and actual results
dotnet fsi prints: 1
Fable REPL prints: 0
Related information
- Fable version: 3.7.0-beta-011
- Operating system: macOS 10.15.7
Description
When a static field has the
[<FSharp.Core.DefaultValue>]attribute, Fable leaves its value asundefined, which can have different behavior than the .NET default value.Repro code
Expected and actual results
dotnet fsiprints: 1Fable REPL prints: 0
Related information