Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/fsharp/tast.fs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ open Microsoft.FSharp.Core.CompilerServices
/// Unique name generator for stamps attached to lambdas and object expressions
type Unique = int64
//++GLOBAL MUTABLE STATE
let newUnique = let mutable i = 0L in fun () -> System.Threading.Interlocked.Increment(&i)
let newUnique = let i = ref 0L in fun () -> System.Threading.Interlocked.Increment(i)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutable is ok, ref also ( there is an old school fan club 😄 )
Maybe there is safer to use ref than remove the warning
👍 for @mpetruska

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, my thoughts exactly. Not too experienced with the build system yet, so I'd rather modify code than build parameters.

type Stamp = int64

/// Unique name generator for stamps attached to to val_specs, tycon_specs etc.
//++GLOBAL MUTABLE STATE
let newStamp = let mutable i = 0L in fun () -> System.Threading.Interlocked.Increment(&i)
let newStamp = let i = ref 0L in fun () -> System.Threading.Interlocked.Increment(i)

/// A global generator of compiler generated names
// ++GLOBAL MUTABLE STATE
Expand Down