From 7dcbd68e40f5f4dea414405ba3e3ba48896690d3 Mon Sep 17 00:00:00 2001 From: "progressive.galib" Date: Tue, 7 Jan 2025 18:27:34 +0000 Subject: [PATCH 1/2] "#if" directive around nullness removed refactored in HashMultiMap from src/Compiler/Utilities/HashMultiMap.fs and fsi Related: #18061 (partially addresses) - [x] Release notes entry updated: in `docs/release-notes/.FSharp.Compiler.Service/9.0.200.md`, --- src/Compiler/Utilities/HashMultiMap.fs | 7 ++----- src/Compiler/Utilities/HashMultiMap.fsi | 6 +----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Compiler/Utilities/HashMultiMap.fs b/src/Compiler/Utilities/HashMultiMap.fs index c0fc897121d..b8c51540bbb 100644 --- a/src/Compiler/Utilities/HashMultiMap.fs +++ b/src/Compiler/Utilities/HashMultiMap.fs @@ -8,11 +8,8 @@ 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. [] -type internal HashMultiMap<'Key, 'Value -#if !NO_CHECKNULLS - when 'Key:not null -#endif - >(size: int, comparer: IEqualityComparer<'Key>, ?useConcurrentDictionary: bool) = +type internal HashMultiMap<'Key, 'Value when 'Key:not null> +(size: int, comparer: IEqualityComparer<'Key>, ?useConcurrentDictionary: bool) = let comparer = comparer diff --git a/src/Compiler/Utilities/HashMultiMap.fsi b/src/Compiler/Utilities/HashMultiMap.fsi index 6a4ba2ce119..c524ff83946 100644 --- a/src/Compiler/Utilities/HashMultiMap.fsi +++ b/src/Compiler/Utilities/HashMultiMap.fsi @@ -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. [] -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> From 6ac8aa58ae82d4203249395fda4d65d094184a17 Mon Sep 17 00:00:00 2001 From: "progressive.galib" Date: Thu, 16 Jan 2025 15:58:40 +0000 Subject: [PATCH 2/2] lets try ci/cd build --- src/Compiler/TypedTree/QuotationPickler.fs | 2 +- src/Compiler/Utilities/HashMultiMap.fs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Compiler/TypedTree/QuotationPickler.fs b/src/Compiler/TypedTree/QuotationPickler.fs index f2a58203ec6..7fa369a63e6 100644 --- a/src/Compiler/TypedTree/QuotationPickler.fs +++ b/src/Compiler/TypedTree/QuotationPickler.fs @@ -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" mutable rows: 'T list mutable count: int } diff --git a/src/Compiler/Utilities/HashMultiMap.fs b/src/Compiler/Utilities/HashMultiMap.fs index b8c51540bbb..965923efb09 100644 --- a/src/Compiler/Utilities/HashMultiMap.fs +++ b/src/Compiler/Utilities/HashMultiMap.fs @@ -8,8 +8,8 @@ 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. [] -type internal HashMultiMap<'Key, 'Value when 'Key:not null> -(size: int, comparer: IEqualityComparer<'Key>, ?useConcurrentDictionary: bool) = +type internal HashMultiMap<'Key, 'Value when 'Key:not null + >(size: int, comparer: IEqualityComparer<'Key>, ?useConcurrentDictionary: bool) = let comparer = comparer