Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"#if" directive around nullness removed refactored in HashMultiMap #18210

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Compiler/TypedTree/QuotationPickler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ module SimplePickle =
when 'T:not null
#endif
> =
{ tbl: HashMultiMap<'T, int> // This should be "Dictionary"
{ tbl: HashMultiMap<'T, int when 'T: not null> // This should be "Dictionary"
Copy link
Member

Choose a reason for hiding this comment

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

Hi @progressive-galib - this won't compile :)
'T is already defined and constrained up above, this should hold for tbl - I don't think changes here are needed.

mutable rows: 'T list
mutable count: int }

Expand Down
5 changes: 1 addition & 4 deletions src/Compiler/Utilities/HashMultiMap.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ open System.Collections.Concurrent
// Each entry in the HashMultiMap dictionary has at least one entry. Under normal usage each entry has _only_
// one entry. So use two hash tables: one for the main entries and one for the overflow.
[<Sealed>]
type internal HashMultiMap<'Key, 'Value
#if !NO_CHECKNULLS
when 'Key:not null
#endif
type internal HashMultiMap<'Key, 'Value when 'Key:not null
>(size: int, comparer: IEqualityComparer<'Key>, ?useConcurrentDictionary: bool) =

let comparer = comparer
Expand Down
6 changes: 1 addition & 5 deletions src/Compiler/Utilities/HashMultiMap.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ open System.Collections.Generic
/// Hash tables, by default based on F# structural "hash" and (=) functions.
/// The table may map a single key to multiple bindings.
[<Sealed>]
type internal HashMultiMap<'Key, 'Value
#if !NO_CHECKNULLS
when 'Key:not null
#endif
> =
type internal HashMultiMap<'Key, 'Value when 'Key:not null> =
/// Create a new empty mutable HashMultiMap with the given key hash/equality functions.
new: comparer: IEqualityComparer<'Key> * ?useConcurrentDictionary: bool -> HashMultiMap<'Key, 'Value>

Expand Down
Loading