Skip to content

Commit

Permalink
Fix some errors - force .fsi files to depend on all previous .fsi fil…
Browse files Browse the repository at this point in the history
…es (short-term fix)
  • Loading branch information
safesparrow committed Nov 4, 2022
1 parent 9f83dc3 commit fcc7537
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Compiler/Facilities/DiagnosticsLogger.fs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ type CapturingDiagnosticsLogger(nm, ?eagerFormat) =
| Some f -> f diagnostic

if severity = FSharpDiagnosticSeverity.Error then
printfn $"\r\nERROR {diagnostic.Exception.Message}\r\n"
errorCount <- errorCount + 1

diagnostics.Add(diagnostic, severity)
Expand Down
12 changes: 12 additions & 0 deletions tests/ParallelTypeCheckingTests/Code/DepResolving.fs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ module internal AutomatedDependencyResolving =

let trie = buildTrie nodes

let fsiFiles =
nodes
|> Array.filter (fun f -> f.File.Name.EndsWith ".fsi")

let processFile (node : FileData) =
let deps =
let fsiDep =
Expand Down Expand Up @@ -224,6 +228,13 @@ module internal AutomatedDependencyResolving =
moduleRefs
|> Array.iter processRef

// Force .fsi files to depend on all other (previous) .fsi files - avoids the issue of TcEnv being overriden
let additionalFsiDeps =
if node.File.Name.EndsWith ".fsi" then
fsiFiles
else
[||]

// Collect files from all reachable TrieNodes
let deps =
reachable
Expand All @@ -233,6 +244,7 @@ module internal AutomatedDependencyResolving =
// For starters: can module abbreviations affect other files?
// If not, then the below is not necessary.
|> Seq.append filesWithModuleAbbreviations
|> Seq.append additionalFsiDeps
|> Seq.append fsiDep
|> Seq.map (fun f -> f.File)
|> Seq.toArray
Expand Down

0 comments on commit fcc7537

Please sign in to comment.