@@ -739,7 +739,7 @@ let ParseOneInputFile (tcConfig: TcConfig, lexResourceManager, fileName, isLastC
739739/// NOTE: this needs to be improved to commit diagnotics as soon as possible
740740///
741741/// NOTE: If StopProcessing is raised by any piece of work then the overall function raises StopProcessing.
742- let UseMultipleDiagnosticLoggers (( inputs , diagnosticsLogger , eagerFormat ): 'a list * DiagnosticsLogger * ( PhasedDiagnostic -> PhasedDiagnostic ) option ) ( f : ( 'a * CapturingDiagnosticsLogger ) list -> 'b ): 'b =
742+ let UseMultipleDiagnosticLoggers ( inputs , diagnosticsLogger , eagerFormat ) f =
743743
744744 // Check input files and create delayed error loggers before we try to parallel parse.
745745 let delayLoggers =
@@ -1078,9 +1078,9 @@ type TcState =
10781078
10791079 member x.WithStuff tcEnv rootSigs creates : TcState =
10801080 { x with
1081- tcsTcSigEnv = tcEnv
1082- tcsRootSigs = rootSigs
1083- tcsCreatesGeneratedProvidedTypes = creates
1081+ tcsTcSigEnv = tcEnv
1082+ tcsRootSigs = rootSigs
1083+ tcsCreatesGeneratedProvidedTypes = creates
10841084 }
10851085
10861086type State = TcState * bool
@@ -1395,8 +1395,6 @@ let CheckOneInput
13951395 )
13961396 }
13971397
1398- type FsiBackedInfo = ModuleOrNamespaceType
1399-
14001398let mutable asts = ConcurrentDictionary< string, ParsedInput>()
14011399
14021400let mutable fsiBackedInfos = ConcurrentDictionary< string, ModuleOrNamespaceType>()
@@ -1495,95 +1493,50 @@ let CheckOneInputAux'
14951493
14961494 // Check if we've got an interface for this fragment
14971495 let rootSigOpt = tcState.tcsRootSigs.TryFind qualNameOfFile
1496+
1497+ // Typecheck the implementation file not backed by a signature file
14981498
1499- match rootSigOpt with
1500- | Some _
1501- // ->
1502- // // Type-check an implementation file backed by a signature file
1503- // // TODO DO NOT
1504- // let info = fsiBackedInfos[file.FileName]
1505- // match info with
1506- // | amap, conditionalDefines, rootSig, priorErrors, file, tcStateForImplFile, ccuSigForFile ->
1507- //
1508- // // Check if we've already seen an implementation for this fragment
1509- // if Zset.contains qualNameOfFile tcStateForImplFile.tcsRootImpls then
1510- // errorR (Error(FSComp.SR.buildImplementationAlreadyGiven (qualNameOfFile.Text), m))
1511- //
1512- // // In the first linear part of parallel checking, we use a 'checkForErrors' that checks either for errors
1513- // // somewhere in the files processed prior to this one, including from the first phase, or in the processing
1514- // // of this particular file.
1515- // // TODO: Are we handling the commented out code somewhere else?
1516- // let checkForErrors2 () = priorErrors // || (logger.ErrorCount > 0)
1517- //
1518- // let topAttrs, implFile, tcEnvAtEnd, createsGeneratedProvidedTypes =
1519- // CheckOneImplFile(
1520- // tcGlobals,
1521- // amap,
1522- // tcStateForImplFile.tcsCcu,
1523- // tcStateForImplFile.tcsImplicitOpenDeclarations,
1524- // checkForErrors2,
1525- // conditionalDefines,
1526- // TcResultsSink.NoSink,
1527- // tcConfig.internalTestSpanStackReferring,
1528- // tcStateForImplFile.tcsTcImplEnv,
1529- // Some rootSig,
1530- // file
1531- // )
1532- // |> Cancellable.runWithoutCancellation
1533- //
1534- // let result = (tcEnvAtEnd, topAttrs, Some implFile, ccuSigForFile)
1535- //
1536- // // Type-check .fs file using dedicated stuff, not the main tcState as that will cause duplicates.
1537- // // Do not return resuling tcState - it shouldn't be used for anything.
1538- // // Return old tcState, with the exception of one flag.
1539- // return fun tcState ->
1540- // result, { tcState with tcsCreatesGeneratedProvidedTypes = tcState.CreatesGeneratedProvidedTypes || createsGeneratedProvidedTypes }
1541- | None ->
1542- // Typecheck the implementation file not backed by a signature file
1499+ // Check if we've already seen an implementation for this fragment
1500+ if Zset.contains qualNameOfFile tcState.tcsRootImpls then
1501+ errorR ( Error( FSComp.SR.buildImplementationAlreadyGiven ( qualNameOfFile.Text), m))
1502+
1503+ let! topAttrs , implFile , tcEnvAtEnd , createsGeneratedProvidedTypes =
1504+ CheckOneImplFile(
1505+ tcGlobals,
1506+ amap,
1507+ tcState.tcsCcu,
1508+ tcState.tcsImplicitOpenDeclarations,
1509+ checkForErrors,
1510+ conditionalDefines,
1511+ tcSink,
1512+ tcConfig.internalTestSpanStackReferring,
1513+ tcState.tcsTcImplEnv,
1514+ rootSigOpt,
1515+ file
1516+ )
1517+
1518+ printfn $" Finished Processing Impl {file.FileName}"
1519+ return fun tcState ->
1520+ let backed = rootSigOpt.IsSome
1521+ printfn $" Applying Impl Backed={backed} {file.FileName}"
15431522
1544- // Check if we've already seen an implementation for this fragment
1545- if Zset.contains qualNameOfFile tcState.tcsRootImpls then
1546- errorR ( Error( FSComp.SR.buildImplementationAlreadyGiven ( qualNameOfFile.Text), m))
1523+ let ccuSigForFile , fsTcState =
1524+ AddCheckResultsToTcState
1525+ ( tcGlobals, amap, false , prefixPathOpt, tcSink, tcState.tcsTcImplEnv, qualNameOfFile, implFile.Signature)
1526+ tcState
15471527
1548- let! topAttrs , implFile , tcEnvAtEnd , createsGeneratedProvidedTypes =
1549- CheckOneImplFile(
1550- tcGlobals,
1551- amap,
1552- tcState.tcsCcu,
1553- tcState.tcsImplicitOpenDeclarations,
1554- checkForErrors,
1555- conditionalDefines,
1556- tcSink,
1557- tcConfig.internalTestSpanStackReferring,
1558- tcState.tcsTcImplEnv,
1559- rootSigOpt,
1560- file
1561- )
1562-
1563- printfn $" Finished Processing Impl {file.FileName}"
1564- return fun tcState ->
1565- let backed = rootSigOpt.IsSome
1566- printfn $" Applying Impl Backed={backed} {file.FileName}"
1567-
1568-
1569-
1570- let ccuSigForFile , fsTcState =
1571- AddCheckResultsToTcState
1572- ( tcGlobals, amap, false , prefixPathOpt, tcSink, tcState.tcsTcImplEnv, qualNameOfFile, implFile.Signature)
1573- tcState
1574-
1575- // backed impl files must not add results as there are already results from .fsi files
1576- //let fsTcState = if backed then tcState else fsTcState
1528+ // backed impl files must not add results as there are already results from .fsi files
1529+ //let fsTcState = if backed then tcState else fsTcState
15771530
1578- let partialResult = tcEnvAtEnd, topAttrs, Some implFile, ccuSigForFile
1579-
1580- let tcState =
1581- { fsTcState with
1582- tcsCreatesGeneratedProvidedTypes = fsTcState.tcsCreatesGeneratedProvidedTypes || createsGeneratedProvidedTypes
1583- }
1531+ let partialResult = tcEnvAtEnd, topAttrs, Some implFile, ccuSigForFile
1532+
1533+ let tcState =
1534+ { fsTcState with
1535+ tcsCreatesGeneratedProvidedTypes = fsTcState.tcsCreatesGeneratedProvidedTypes || createsGeneratedProvidedTypes
1536+ }
15841537
1585- printfn $" Finished applying Impl {file.FileName}"
1586- partialResult, tcState
1538+ printfn $" Finished applying Impl {file.FileName}"
1539+ partialResult, tcState
15871540
15881541 with e ->
15891542 errorRecovery e range0
@@ -1660,9 +1613,8 @@ let CheckClosedInputSetFinish (declaredImpls: CheckedImplFile list, tcState) =
16601613 tcState, declaredImpls, ccuContents
16611614
16621615let CheckMultipleInputsSequential ( ctok , checkForErrors , tcConfig , tcImports , tcGlobals , prefixPathOpt , tcState , inputs ) =
1663- let args = ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, false
16641616 ( tcState, inputs)
1665- ||> List.mapFold ( CheckOneInputEntry args )
1617+ ||> List.mapFold ( CheckOneInputEntry( ctok , checkForErrors , tcConfig , tcImports , tcGlobals , prefixPathOpt , false ) )
16661618
16671619/// Use parallel checking of implementation files that have signature files
16681620let CheckMultipleInputsInParallel
0 commit comments