Skip to content

Commit 9fa6952

Browse files
committed
Run Fantomas
1 parent a1fd757 commit 9fa6952

File tree

4 files changed

+50
-37
lines changed

4 files changed

+50
-37
lines changed

src/Compiler/Driver/ParseAndCheckInputs.fs

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,27 +1464,31 @@ let CheckOneInputAux'
14641464
fsiBackedInfos[file.FileName] <- sigFileType
14651465

14661466
// printfn $"Finished Processing Sig {file.FileName}"
1467-
return fun tcState ->
1468-
// printfn $"Applying Sig {file.FileName}"
1469-
let fsiPartialResult, tcState =
1470-
let rootSigs = Zmap.add qualNameOfFile sigFileType tcState.tcsRootSigs
1471-
let tcSigEnv =
1472-
AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcState.tcsTcSigEnv sigFileType
1473-
1474-
// Add the signature to the signature env (unless it had an explicit signature)
1475-
let ccuSigForFile = CombineCcuContentFragments [ sigFileType; tcState.tcsCcuSig ]
1476-
1477-
let partialResult = tcEnv, EmptyTopAttrs, None, ccuSigForFile
1478-
1479-
let tcState =
1480-
{ tcState with
1481-
tcsTcSigEnv = tcSigEnv
1482-
tcsRootSigs = rootSigs
1483-
tcsCreatesGeneratedProvidedTypes = tcState.tcsCreatesGeneratedProvidedTypes || createsGeneratedProvidedTypes
1484-
}
1485-
partialResult, tcState
1467+
return
1468+
fun tcState ->
1469+
// printfn $"Applying Sig {file.FileName}"
1470+
let fsiPartialResult, tcState =
1471+
let rootSigs = Zmap.add qualNameOfFile sigFileType tcState.tcsRootSigs
1472+
1473+
let tcSigEnv =
1474+
AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcState.tcsTcSigEnv sigFileType
1475+
1476+
// Add the signature to the signature env (unless it had an explicit signature)
1477+
let ccuSigForFile = CombineCcuContentFragments [ sigFileType; tcState.tcsCcuSig ]
1478+
1479+
let partialResult = tcEnv, EmptyTopAttrs, None, ccuSigForFile
1480+
1481+
let tcState =
1482+
{ tcState with
1483+
tcsTcSigEnv = tcSigEnv
1484+
tcsRootSigs = rootSigs
1485+
tcsCreatesGeneratedProvidedTypes =
1486+
tcState.tcsCreatesGeneratedProvidedTypes || createsGeneratedProvidedTypes
1487+
}
1488+
1489+
partialResult, tcState
14861490

1487-
fsiPartialResult, tcState
1491+
fsiPartialResult, tcState
14881492

14891493
| ParsedInput.ImplFile file ->
14901494
// printfn $"Processing Impl {file.FileName}"

tests/ParallelTypeCheckingTests/Code/DependencyResolution.fs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ module internal DependencyResolution =
149149

150150
let trie = buildTrie nodes
151151

152-
let processFile (node : FileData) =
152+
let processFile (node: FileData) =
153153
let deps =
154154
let fsiDep =
155155
if node.File.FsiBacked then
@@ -222,9 +222,8 @@ module internal DependencyResolution =
222222
let moduleRefs = Array.append node.Data.Tops node.Data.ModuleRefs
223223

224224
// Process module refs in order, marking more and more TrieNodes as reachable and potential prefixes
225-
moduleRefs
226-
|> Array.iter processRef
227-
225+
moduleRefs |> Array.iter processRef
226+
228227
// Collect files from all reachable TrieNodes
229228
let deps =
230229
reachable

tests/ParallelTypeCheckingTests/Tests/TestCompilation.fs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,53 +126,62 @@ namespace A
126126
module B
127127
open A
128128
"""
129-
] |> FProject.Make CompileOutput.Library
130-
129+
]
130+
|> FProject.Make CompileOutput.Library
131+
131132
let dependentSignatures =
132133
[
133-
"A.fsi", """
134+
"A.fsi",
135+
"""
134136
module A
135137
136138
type AType = class end
137139
"""
138-
"A.fs", """
140+
"A.fs",
141+
"""
139142
module A
140143
141144
type AType = class end
142145
"""
143-
"B.fsi", """
146+
"B.fsi",
147+
"""
144148
module B
145149
146150
open A
147151
148152
val b: AType -> unit
149153
"""
150-
"B.fs", """
154+
"B.fs",
155+
"""
151156
module B
152157
153158
open A
154159
155160
let b (a:AType) = ()
156161
"""
157-
"C.fsi", """
162+
"C.fsi",
163+
"""
158164
module C
159165
160166
type CType = class end
161167
"""
162-
"C.fs", """
168+
"C.fs",
169+
"""
163170
module C
164171
165172
type CType = class end
166173
"""
167-
"D.fsi", """
174+
"D.fsi",
175+
"""
168176
module D
169177
170178
open A
171179
open C
172180
173181
val d: CType -> unit
174182
"""
175-
"D.fs", """
183+
"D.fs",
184+
"""
176185
module D
177186
178187
open A
@@ -184,8 +193,8 @@ let d (c: CType) =
184193
b a
185194
"""
186195
]
187-
|> FProject.Make CompileOutput.Library
188-
196+
|> FProject.Make CompileOutput.Library
197+
189198
let all =
190199
[
191200
encodeDecodeSimple

tests/ParallelTypeCheckingTests/Tests/TestDependencyResolution.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ let ``Analyse whole projects and print statistics`` (projectFile: string) =
269269
files
270270
|> Array.Parallel.mapi (fun i f ->
271271
let code = System.IO.File.ReadAllText(f)
272-
let ast = parseSourceCode(f, code)
272+
let ast = parseSourceCode (f, code)
273+
273274
{
274275
Idx = FileIdx.make i
275276
//Code = code

0 commit comments

Comments
 (0)