Skip to content

Commit 7ce0ec4

Browse files
committed
Remove hardcoded signature dependency and add failing test.
1 parent b0d5af0 commit 7ce0ec4

File tree

2 files changed

+60
-13
lines changed

2 files changed

+60
-13
lines changed

tests/ParallelTypeCheckingTests/Code/DependencyResolution.fs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,7 @@ module internal DependencyResolution =
147147
|> Array.exists (function Abbreviation.ModuleAbbreviation -> true | _ -> false))
148148

149149
let trie = buildTrie nodes
150-
151-
let fsiFiles =
152-
nodes
153-
|> Array.filter (fun f -> match f.File.AST with | ASTOrFsix.AST (ParsedInput.SigFile _) -> true | _ -> false)
154-
150+
155151
let processFile (node : FileData) =
156152
let deps =
157153
let fsiDep =
@@ -229,21 +225,13 @@ module internal DependencyResolution =
229225
moduleRefs
230226
|> Array.iter processRef
231227

232-
// Force .fsi files to depend on all other (previous) .fsi files - avoids the issue of TcEnv being overriden
233-
let additionalFsiDeps =
234-
if node.File.Name.EndsWith ".fsi" then
235-
nodes
236-
else
237-
[||]
238-
239228
// Collect files from all reachable TrieNodes
240229
let deps =
241230
reachable
242231
|> Seq.collect (fun node -> node.Files)
243232
// Assume that this file depends on all files that have any module abbreviations - this is probably unnecessary.
244233
// TODO Handle module abbreviations in a better way
245234
|> Seq.append filesWithModuleAbbreviations
246-
|> Seq.append additionalFsiDeps
247235
|> Seq.append fsiDep
248236
|> Seq.map (fun f -> f.File)
249237
|> Seq.toArray

tests/ParallelTypeCheckingTests/Tests/TestCompilation.fs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,71 @@ open A
115115
"""
116116
] |> FProject.Make CompileOutput.Library
117117

118+
let dependentSignatures =
119+
[
120+
"A.fsi", """
121+
module A
122+
123+
type AType = class end
124+
"""
125+
"A.fs", """
126+
module A
127+
128+
type AType = class end
129+
"""
130+
"B.fsi", """
131+
module B
132+
133+
open A
134+
135+
val b: AType -> unit
136+
"""
137+
"B.fs", """
138+
module B
139+
140+
open A
141+
142+
let b (a:AType) = ()
143+
"""
144+
"C.fsi", """
145+
module C
146+
147+
type CType = class end
148+
"""
149+
"C.fs", """
150+
module C
151+
152+
type CType = class end
153+
"""
154+
"D.fsi", """
155+
module D
156+
157+
open A
158+
open C
159+
160+
val d: CType -> unit
161+
"""
162+
"D.fs", """
163+
module D
164+
165+
open A
166+
open B
167+
open C
168+
169+
let d (c: CType) =
170+
let a : AType = failwith "todo"
171+
b a
172+
"""
173+
]
174+
|> FProject.Make CompileOutput.Library
175+
118176
let all =
119177
[
120178
encodeDecodeSimple
121179
diamondBroken1
122180
fsFsi
123181
emptyNamespace
182+
dependentSignatures
124183
]
125184

126185
type Case =

0 commit comments

Comments
 (0)