Skip to content

Commit

Permalink
Fixed merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ncave committed Nov 14, 2022
1 parent 48821cf commit 9566bbf
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 24 deletions.
5 changes: 2 additions & 3 deletions fcs/fcs-fable/service_slim.fs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,9 @@ type internal CompilerStateCache(readAllBytes: string -> byte[], projectOptions:
)
#endif

let niceNameGen = NiceNameGenerator()
let assemblyName = projectOptions.ProjectFileName |> Path.GetFileNameWithoutExtension
let tcInitial, openDecls0 = GetInitialTcEnv (assemblyName, rangeStartup, tcConfig, tcImports, tcGlobals)
let tcInitialState = GetInitialTcState (rangeStartup, assemblyName, tcConfig, tcGlobals, tcImports, niceNameGen, tcInitial, openDecls0)
let tcInitialState = GetInitialTcState (rangeStartup, assemblyName, tcConfig, tcGlobals, tcImports, tcInitial, openDecls0)

// parse cache, keyed on file name and source hash
let parseCache = ConcurrentDictionary<string * int, FSharpParseFileResults>(HashIdentity.Structural)
Expand Down Expand Up @@ -190,7 +189,7 @@ module internal ParseAndCheck =
let input = parseResults.ParseTree
let diagnosticsOptions = compilerState.tcConfig.diagnosticsOptions
let capturingLogger = CompilationDiagnosticLogger("TypeCheckFile", diagnosticsOptions)
let diagnosticsLogger = GetDiagnosticsLoggerFilteringByScopedPragmas(false, GetScopedPragmasForInput(input), diagnosticsOptions, capturingLogger)
let diagnosticsLogger = GetDiagnosticsLoggerFilteringByScopedPragmas(false, input.ScopedPragmas, diagnosticsOptions, capturingLogger)
use _scope = new CompilationGlobalsScope (diagnosticsLogger, BuildPhase.TypeCheck)

let checkForErrors () = parseResults.ParseHadErrors || diagnosticsLogger.ErrorCount > 0
Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/AbstractIL/ilread.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1333,14 +1333,14 @@ let seekReadIndexedRowsRange numRows binaryChop (reader: ISeekReadIndexedRowRead

startRid, endRid

let seekReadIndexedRowsByInterface numRows binaryChop (reader: ISeekReadIndexedRowReader<'RowT, _, _>) =
let seekReadIndexedRowsByInterface numRows binaryChop (reader: ISeekReadIndexedRowReader<CustomAttributeRow, 'KeyT, 'T>) =
let startRid, endRid = seekReadIndexedRowsRange numRows binaryChop reader

if startRid <= 0 || endRid < startRid then
[||]
else
Array.init (endRid - startRid + 1) (fun i ->
let mutable row = Unchecked.defaultof<'RowT>
let mutable row = ref Unchecked.defaultof<CustomAttributeRow>
reader.GetRow(startRid + i, row)
reader.ConvertRow(row))

Expand Down
2 changes: 2 additions & 0 deletions src/Compiler/Driver/CompilerConfig.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,8 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
errorRecovery e range0
[]

#endif //!FABLE_COMPILER

member _.bufferWidth = data.bufferWidth
member _.fsiMultiAssemblyEmit = data.fsiMultiAssemblyEmit
member _.FxResolver = data.FxResolver
Expand Down
2 changes: 2 additions & 0 deletions src/Compiler/Driver/CompilerConfig.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -867,9 +867,11 @@ type TcConfig =

/// Check if the primary assembly is mscorlib
member assumeDotNetFramework: bool
#endif //!FABLE_COMPILER

member exiter: Exiter

#if !FABLE_COMPILER
member parallelReferenceResolution: ParallelReferenceResolution

/// Represents a computation to return a TcConfig. Normally this is just a constant immutable TcConfig,
Expand Down
2 changes: 2 additions & 0 deletions src/Compiler/Driver/CompilerDiagnostics.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type PhasedDiagnostic with
/// Indicates if a diagnostic should be reported as an error
member ReportAsError: FSharpDiagnosticOptions * FSharpDiagnosticSeverity -> bool

#if !FABLE_COMPILER
/// Output all of a diagnostic to a buffer, including range
member Output: buf: StringBuilder * tcConfig: TcConfig * severity: FSharpDiagnosticSeverity -> unit

Expand All @@ -81,6 +82,7 @@ type PhasedDiagnostic with
tcConfig: TcConfig *
severity: FSharpDiagnosticSeverity ->
unit
#endif //!FABLE_COMPILER

/// Get a diagnostics logger that filters the reporting of warnings based on scoped pragma information
val GetDiagnosticsLoggerFilteringByScopedPragmas:
Expand Down
11 changes: 10 additions & 1 deletion src/Compiler/Driver/ParseAndCheckInputs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,8 @@ let CheckMultipleInputsSequential (ctok, checkForErrors, tcConfig, tcImports, tc
(tcState, inputs)
||> List.mapFold (CheckOneInputEntry(ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, false))

#if !FABLE_COMPILER

/// Use parallel checking of implementation files that have signature files
let CheckMultipleInputsInParallel
(
Expand Down Expand Up @@ -1511,12 +1513,19 @@ let CheckMultipleInputsInParallel

results, tcState)

let CheckClosedInputSet (ctok, checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, eagerFormat, inputs) =
#endif //!FABLE_COMPILER

let CheckClosedInputSet (ctok, checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, eagerFormat: (PhasedDiagnostic -> PhasedDiagnostic), inputs) =
// tcEnvAtEndOfLastFile is the environment required by fsi.exe when incrementally adding definitions
#if FABLE_COMPILER
ignore eagerFormat
#endif
let results, tcState =
#if !FABLE_COMPILER
if tcConfig.parallelCheckingWithSignatureFiles then
CheckMultipleInputsInParallel(ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, eagerFormat, inputs)
else
#endif //!FABLE_COMPILER
CheckMultipleInputsSequential(ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, inputs)

let (tcEnvAtEndOfLastFile, topAttrs, implFiles, _), tcState =
Expand Down
2 changes: 2 additions & 0 deletions src/Compiler/Facilities/DiagnosticsLogger.fs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ let rec AttachRange m (exn: exn) =
| Failure msg -> InternalError(msg + " (Failure)", m)
#if !FABLE_COMPILER
| :? ArgumentException as exn -> InternalError(exn.Message + " (ArgumentException)", m)
#endif
| _ -> exn

type Exiter =
Expand Down Expand Up @@ -859,6 +860,7 @@ type StackGuard(maxDepth: int, name: string) =
#if FABLE_COMPILER
ignore depth
ignore maxDepth
ignore name
f ()
#else //!FABLE_COMPILER
depth <- depth + 1
Expand Down
4 changes: 4 additions & 0 deletions src/Compiler/Service/FSharpCheckerResults.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2845,7 +2845,11 @@ type FSharpCheckFileResults

match pageWidth with
| None -> layout
#if FABLE_COMPILER
| Some _pageWidth -> layout
#else
| Some pageWidth -> Display.squashTo pageWidth layout
#endif
|> LayoutRender.showL
|> SourceText.ofString)

Expand Down
18 changes: 0 additions & 18 deletions src/Compiler/Service/FSharpCheckerResults.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -587,24 +587,6 @@ module internal ParseAndCheckFile =
suggestNamesForErrors: bool ->
(range * range)[]

// #if FABLE_COMPILER
// val CheckOneFile:
// parseResults: FSharpParseFileResults *
// sourceText: ISourceText *
// mainInputFileName: string *
// projectOptions: FSharpProjectOptions *
// projectFileName: string *
// tcConfig: TcConfig *
// tcGlobals: TcGlobals *
// tcImports: TcImports *
// tcState: TcState *
// moduleNamesDict: ModuleNamesDict *
// loadClosure: LoadClosure option *
// backgroundDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity)[] *
// suggestNamesForErrors: bool
// -> Cancellable<FSharpDiagnostic[] * TypeCheckInfo>
// #endif

#if !FABLE_COMPILER

// An object to typecheck source in a given typechecking environment.
Expand Down

0 comments on commit 9566bbf

Please sign in to comment.