Skip to content

Commit 2f36fe6

Browse files
committed
Fixed merge
1 parent cb7ce73 commit 2f36fe6

File tree

11 files changed

+35
-53
lines changed

11 files changed

+35
-53
lines changed

fcs/fcs-fable/System.Collections.fs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module Immutable =
3434
type ImmutableArray<'T> =
3535
static member CreateBuilder() = ResizeArray<'T>()
3636

37+
[<Sealed>]
3738
type ImmutableHashSet<'T>(values: 'T seq) =
3839
let xs = HashSet<'T>(values)
3940

@@ -62,13 +63,21 @@ module Immutable =
6263
member _.GetEnumerator(): IEnumerator<'T> =
6364
xs.GetEnumerator()
6465

65-
type ImmutableDictionary<'Key, 'Value when 'Key: equality>(pairs: KeyValuePair<'Key, 'Value> seq) =
66-
let xs = Dictionary<'Key, 'Value>()
67-
do for pair in pairs do xs.Add(pair.Key, pair.Value)
66+
[<Sealed>]
67+
type ImmutableDictionary<'Key, 'Value when 'Key: equality>(xs: Dictionary<'Key, 'Value>) =
68+
static member Create(comparer: IEqualityComparer<'Key>) =
69+
ImmutableDictionary<'Key, 'Value>(Dictionary(comparer))
6870

69-
static member CreateRange(items) = ImmutableDictionary<'Key, 'Value>(items)
70-
static member Empty = ImmutableDictionary<'Key, 'Value>(Array.empty)
71+
static member CreateRange(items: IEnumerable<KeyValuePair<'Key, 'Value>>) =
72+
let xs = Dictionary<'Key, 'Value>()
73+
for pair in items do
74+
xs.Add(pair.Key, pair.Value)
75+
ImmutableDictionary<'Key, 'Value>(xs)
7176

77+
static member Empty =
78+
ImmutableDictionary<'Key, 'Value>(Dictionary())
79+
80+
member _.IsEmpty = xs.Count = 0
7281
member _.Item with get (key: 'Key): 'Value = xs[key]
7382
member _.ContainsKey (key: 'Key) = xs.ContainsKey(key)
7483

fcs/fcs-fable/TcImports_shim.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ module TcImports =
176176
XmlDocumentationInfo = None
177177
}
178178

179-
let optdata = lazy (
179+
let optdata = InterruptibleLazy(fun _ ->
180180
match memoize_opt.Apply ccuName with
181181
| None -> None
182182
| Some data ->

fcs/fcs-fable/fcs-fable.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
<!-- <Compile Include="$(FSharpSourcesRoot)/Facilities/CompilerLocation.fs" /> -->
9494
<Compile Include="$(FSharpSourcesRoot)/Facilities/BuildGraph.fsi" />
9595
<Compile Include="$(FSharpSourcesRoot)/Facilities/BuildGraph.fs" />
96-
<Compile Include="$(FSharpSourcesRoot)/Utilities/ReadOnlySpan.fsi" />
97-
<Compile Include="$(FSharpSourcesRoot)/Utilities/ReadOnlySpan.fs" />
96+
<!-- <Compile Include="$(FSharpSourcesRoot)/Utilities/ReadOnlySpan.fsi" /> -->
97+
<!-- <Compile Include="$(FSharpSourcesRoot)/Utilities/ReadOnlySpan.fs" /> -->
9898
<!-- <FsLex Include="$(FSharpSourcesRoot)/AbstractIL/illex.fsl" /> -->
9999
<!-- <None Include="$(FSharpSourcesRoot)/AbstractIL/illex.fsl" /> -->
100100
<!-- <FsYacc Include="$(FSharpSourcesRoot)/AbstractIL/ilpars.fsy" /> -->

fcs/fcs-fable/test/fcs-fable-test.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<ItemGroup>
2121
<!-- <PackageReference Include="FSharp.Core" Version="8.0.0" /> -->
2222
<!-- <Reference Include="../../../artifacts/bin/FSharp.Compiler.Service/Release/netstandard2.0/FSharp.Core.dll" /> -->
23-
<PackageReference Include="Fable.Core" Version="4.1.0" />
23+
<PackageReference Include="Fable.Core" Version="4.2.0" />
2424
</ItemGroup>
2525

2626
</Project>

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"sdk": {
3-
"version": "8.0.100-rc.1.23463.5",
3+
"version": "8.0.100",
44
"allowPrerelease": true
55
},
66
"tools": {
7-
"dotnet": "8.0.100-rc.1.23463.5",
7+
"dotnet": "8.0.100",
88
"vs": {
99
"version": "17.6",
1010
"components": [

src/Compiler/AbstractIL/ilread.fs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,19 +1219,14 @@ type ISeekReadIndexedRowReader<'RowT, 'KeyT, 'T when 'RowT: struct> =
12191219
abstract CompareKey: 'KeyT -> int
12201220
abstract ConvertRow: ref<'RowT> -> 'T
12211221

1222-
#if FABLE_COMPILER
12231222
[<Struct>]
12241223
type CustomAttributeRow =
12251224
val mutable parentIndex: TaggedIndex<HasCustomAttributeTag>
12261225
val mutable typeIndex: TaggedIndex<CustomAttributeTypeTag>
12271226
val mutable valueIndex: int
12281227

1229-
let seekReadIndexedRowsRange numRows binaryChop (reader: ISeekReadIndexedRowReader<CustomAttributeRow, 'KeyT, 'T>) =
1228+
let seekReadIndexedRowsRange numRows binaryChop (reader: ISeekReadIndexedRowReader<CustomAttributeRow, _, _>) =
12301229
let mutable row = ref Unchecked.defaultof<CustomAttributeRow>
1231-
#else
1232-
let seekReadIndexedRowsRange numRows binaryChop (reader: ISeekReadIndexedRowReader<'RowT, _, _>) =
1233-
let mutable row = Unchecked.defaultof<'RowT>
1234-
#endif
12351230

12361231
let mutable startRid = -1
12371232
let mutable endRid = -1
@@ -1310,9 +1305,9 @@ let seekReadIndexedRowsRange numRows binaryChop (reader: ISeekReadIndexedRowRead
13101305
let mutable fin = false
13111306

13121307
while rid <= numRows && not fin do
1313-
reader.GetRow(rid, &row)
1308+
reader.GetRow(rid, row)
13141309

1315-
if reader.CompareKey(reader.GetKey(&row)) = 0 then
1310+
if reader.CompareKey(reader.GetKey(row)) = 0 then
13161311
endRid <- rid
13171312
else
13181313
fin <- true
@@ -1321,17 +1316,17 @@ let seekReadIndexedRowsRange numRows binaryChop (reader: ISeekReadIndexedRowRead
13211316

13221317
startRid, endRid
13231318

1324-
let seekReadIndexedRowsByInterface numRows binaryChop (reader: ISeekReadIndexedRowReader<'RowT, _, _>) =
1319+
let seekReadIndexedRowsByInterface numRows binaryChop (reader: ISeekReadIndexedRowReader<CustomAttributeRow, _, _>) =
13251320
let startRid, endRid = seekReadIndexedRowsRange numRows binaryChop reader
13261321

13271322
if startRid <= 0 || endRid < startRid then
13281323
[||]
13291324
else
13301325

13311326
Array.init (endRid - startRid + 1) (fun i ->
1332-
let mutable row = Unchecked.defaultof<'RowT>
1333-
reader.GetRow(startRid + i, &row)
1334-
reader.ConvertRow(&row))
1327+
let mutable row = ref Unchecked.defaultof<CustomAttributeRow>
1328+
reader.GetRow(startRid + i, row)
1329+
reader.ConvertRow(row))
13351330

13361331
let inline rowAddr (ctxt: ILMetadataReader) (tn: TableName) (idx: int) =
13371332
ref (ctxt.rowAddr tn idx)

src/Compiler/Checking/QuotationTranslator.fs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,9 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP.
718718
let witnessArgInfo =
719719
if g.generateWitnesses && inWitnessPassingScope then
720720
let witnessInfo = traitInfo.GetWitnessInfo()
721-
#if FABLE_COMPILER
722-
env.witnessesInScope.TryFind witnessInfo
723-
#else
724721
match env.witnessesInScope.TryGetValue witnessInfo with
725722
| true, storage -> Some storage
726723
| _ -> None
727-
#endif
728724
else
729725
None
730726

src/Compiler/CodeGen/IlxGen.fs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,13 +1318,9 @@ let ComputeGenerateWitnesses (g: TcGlobals) eenv =
13181318
&& not eenv.suppressWitnesses
13191319

13201320
let TryStorageForWitness (_g: TcGlobals) eenv (w: TraitWitnessInfo) =
1321-
#if FABLE_COMPILER
1322-
eenv.witnessesInScope.TryFind w
1323-
#else
13241321
match eenv.witnessesInScope.TryGetValue w with
13251322
| true, storage -> Some storage
13261323
| _ -> None
1327-
#endif
13281324

13291325
let IsValRefIsDllImport g (vref: ValRef) =
13301326
vref.Attribs |> HasFSharpAttributeOpt g g.attrib_DllImportAttribute

src/Compiler/TypedTree/TypedTreeOps.fs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10293,23 +10293,6 @@ let CombineCcuContentFragments l =
1029310293
/// An immutable mappping from witnesses to some data.
1029410294
///
1029510295
/// Note: this uses an immutable HashMap/Dictionary with an IEqualityComparer that captures TcGlobals, see EmptyTraitWitnessInfoHashMap
10296-
#if FABLE_COMPILER
10297-
type TraitWitnessInfoHashMap<'T> = Internal.Utilities.Collections.Tagged.Map<TraitWitnessInfo, 'T>
10298-
10299-
/// Create an empty immutable mapping from witnesses to some data
10300-
let EmptyTraitWitnessInfoHashMap g : TraitWitnessInfoHashMap<'T> =
10301-
let comparer =
10302-
{ new IComparer<TraitWitnessInfo> with
10303-
member _.Compare(x, y) =
10304-
let xhash = hash x
10305-
let yhash = hash y
10306-
let equals x y = traitKeysAEquiv g TypeEquivEnv.Empty x y
10307-
if xhash = yhash
10308-
then if equals x y then 0 else -1
10309-
else if xhash < yhash then -1 else 1
10310-
}
10311-
Internal.Utilities.Collections.Tagged.Map<_,_>.FromList(comparer, [])
10312-
#else //!FABLE_COMPILER
1031310296
type TraitWitnessInfoHashMap<'T> = ImmutableDictionary<TraitWitnessInfo, 'T>
1031410297

1031510298
/// Create an empty immutable mapping from witnesses to some data
@@ -10319,7 +10302,6 @@ let EmptyTraitWitnessInfoHashMap g : TraitWitnessInfoHashMap<'T> =
1031910302
member _.Equals(a, b) = traitKeysAEquiv g TypeEquivEnv.Empty a b
1032010303
member _.GetHashCode(a) = hash a.MemberName
1032110304
})
10322-
#endif //!FABLE_COMPILER
1032310305

1032410306
let (|WhileExpr|_|) expr =
1032510307
match expr with

src/Compiler/TypedTree/TypedTreeOps.fsi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,11 +2585,7 @@ val GetTraitWitnessInfosOfTypars: TcGlobals -> numParentTypars: int -> typars: T
25852585
/// An immutable mappping from witnesses to some data.
25862586
///
25872587
/// Note: this uses an immutable HashMap/Dictionary with an IEqualityComparer that captures TcGlobals, see EmptyTraitWitnessInfoHashMap
2588-
#if FABLE_COMPILER
2589-
type TraitWitnessInfoHashMap<'T> = Internal.Utilities.Collections.Tagged.Map<TraitWitnessInfo, 'T>
2590-
#else
25912588
type TraitWitnessInfoHashMap<'T> = ImmutableDictionary<TraitWitnessInfo, 'T>
2592-
#endif
25932589

25942590
/// Create an empty immutable mapping from witnesses to some data
25952591
val EmptyTraitWitnessInfoHashMap: TcGlobals -> TraitWitnessInfoHashMap<'T>

0 commit comments

Comments
 (0)