Skip to content

Commit 9f991d4

Browse files
committed
still doesn't work
1 parent 3e65c3c commit 9f991d4

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

src/Compiler/Driver/ParseAndCheckInputs.fs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,11 +1603,18 @@ let CheckOneInputAux'
16031603

16041604
printfn $"Finished Processing Impl {file.FileName}"
16051605
return fun tcState ->
1606-
printfn $"Applying Impl {file.FileName}"
1606+
let backed = rootSigOpt.IsSome
1607+
printfn $"Applying Impl Backed={backed} {file.FileName}"
1608+
1609+
1610+
16071611
let ccuSigForFile, fsTcState =
16081612
AddCheckResultsToTcState
16091613
(tcGlobals, amap, false, prefixPathOpt, tcSink, tcState.tcsTcImplEnv, qualNameOfFile, implFile.Signature)
16101614
tcState
1615+
1616+
// backed impl files must not add results as there are already results from .fsi files
1617+
let fsTcState = if backed then tcState else fsTcState
16111618

16121619
let partialResult = tcEnvAtEnd, topAttrs, Some implFile, ccuSigForFile
16131620

tests/FSharp.Compiler.Service.Tests2/DepResolving.fs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ module internal AutomatedDependencyResolving =
151151
let deps =
152152
// Assume that a file with module abbreviations can depend on anything
153153
match node.Data.ContainsModuleAbbreviations with
154-
| true -> nodes
154+
| true -> nodes |> Array.map (fun n -> n.File)
155155
| false ->
156156
// Clone the original Trie as we're going to mutate the copy
157157
let trie = cloneTrie trie
@@ -226,16 +226,18 @@ module internal AutomatedDependencyResolving =
226226
// For starters: can module abbreviations affect other files?
227227
// If not, then the below is not necessary.
228228
|> Seq.append filesWithModuleAbbreviations
229+
|> Seq.map (fun f -> f.File)
229230
|> Seq.toArray
230231

231232
deps
232233
// We know a file can't depend on a file further down in the project definition (or on itself)
233-
|> Array.filter (fun dep -> dep.File.Idx < node.File.Idx)
234+
|> Array.filter (fun dep -> dep.Idx < node.File.Idx)
234235
// Filter out deps onto .fs files that have backing .fsi files
235-
|> Array.filter (fun dep -> not dep.File.FsiBacked)
236+
|> Array.filter (fun dep -> not dep.FsiBacked)
237+
|> Array.distinct
236238

237239
// Return the node and its dependencies
238-
node.File, deps |> Array.map (fun d -> d.File)
240+
node.File, deps
239241

240242
// Find dependencies for all files
241243
let graph =
@@ -248,9 +250,11 @@ module internal AutomatedDependencyResolving =
248250
let totalSize1 =
249251
graph
250252
|> Seq.sumBy (fun (KeyValue(k,v)) -> v.Length)
251-
let totalSize2 =
253+
let t =
252254
graph
253255
|> Graph.transitive
256+
let totalSize2 =
257+
t
254258
|> Seq.sumBy (fun (KeyValue(k,v)) -> v.Length)
255259

256260
printfn $"Non-transitive size: {totalSize1}, transitive size: {totalSize2}"

tests/FSharp.Compiler.Service.Tests2/DiamondArgs.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,10 @@
209209
--simpleresolution
210210
--refout:C:\projekty\fsharp\heuristic\artifacts\obj\DiamondTest\Debug\net7.0\refint\DiamondTest.dll
211211
C:\projekty\fsharp\heuristic\tests\DiamondTest\A.fsi
212-
C:\projekty\fsharp\heuristic\tests\DiamondTest\A.fs
212+
C:\projekty\fsharp\heuristic\tests\DiamondTest\A.fs
213+
C:\projekty\fsharp\heuristic\tests\DiamondTest\B1.fs
214+
C:\projekty\fsharp\heuristic\tests\DiamondTest\B2.fs
215+
C:\projekty\fsharp\heuristic\tests\DiamondTest\C1.fs
216+
C:\projekty\fsharp\heuristic\tests\DiamondTest\C2.fs
217+
C:\projekty\fsharp\heuristic\tests\DiamondTest\D.fs
218+
C:\projekty\fsharp\heuristic\tests\DiamondTest\Program.fs

tests/FSharp.Compiler.Service.Tests2/ParallelTypeChecking.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ module internal Real =
210210
printfn $"Finished Processing X {file.Name}"
211211
return
212212
(fun (state : State) ->
213+
// (tcState.TcEnvFromImpls, EmptyTopAttrs, None, ccuSigForFile), state
213214
printfn $"Applying X state {file.Name}"
214215
let tcState, priorErrors = state
215216
// (tcState.TcEnvFromImpls, EmptyTopAttrs, None, ccuSigForFile), state

0 commit comments

Comments
 (0)