From 60f5b6a1c1f876d563910ef488b347a99ed8bf21 Mon Sep 17 00:00:00 2001 From: Petr Date: Tue, 13 Sep 2022 14:37:20 +0200 Subject: [PATCH] One more occasion --- src/Compiler/Facilities/DiagnosticsLogger.fs | 1 + src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index 4c82c5f445a..3f9722ac81e 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -169,6 +169,7 @@ let QuitProcessExiter = member _.Exit n = try Environment.Exit n + raise StopProcessing with _ -> () diff --git a/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs b/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs index 26b43155830..df6b7281101 100644 --- a/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs +++ b/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs @@ -8,6 +8,7 @@ namespace FSharp.Compiler.CodeAnalysis.Hosted open System open System.IO open System.Text.RegularExpressions +open FSharp.Compiler open FSharp.Compiler.Diagnostics open FSharp.Compiler.Driver open FSharp.Compiler.DiagnosticsLogger @@ -97,9 +98,7 @@ type internal InProcCompiler(legacyReferenceResolver) = let loggerProvider = InProcDiagnosticsLoggerProvider() let mutable exitCode = 0 - let exiter = - { new Exiter with - member _.Exit n = exitCode <- n; raise StopProcessing } + let exiter = DiagnosticsLogger.QuitProcessExiter try CompileFromCommandLineArguments ( ctok, argv, legacyReferenceResolver,