Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitee84eb7

Browse files
dsymeKevinRansom
authored andcommitted
fix syntax errors and transitive errors in scripts (dotnet#1963)
* fix 1962* fix warnings* simplify diagnostics processing* simplify diagnostics processing (2)* remove project* fix build* fix build* fix build* fix build* merge master* fix build of tests* fix error flag* fix tests and build* fix tests* fix test* test diagnostic* fix isError mistake and clarify namings Error --> Diagnostic
1 parent6638ed3 commitee84eb7

File tree

54 files changed

+982
-741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+982
-741
lines changed

‎FSharp.sln‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,6 @@ Global
196196
{4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|Any CPU.Build.0=Release|Any CPU
197197
{4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|x86.ActiveCfg=Release|Any CPU
198198
{4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|x86.Build.0=Release|Any CPU
199-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91}.Debug|Any CPU.ActiveCfg=Debug|Any CPU
200-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91}.Debug|Any CPU.Build.0=Debug|Any CPU
201-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91}.Debug|x86.ActiveCfg=Debug|Any CPU
202-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91}.Debug|x86.Build.0=Debug|Any CPU
203-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91}.Proto|Any CPU.ActiveCfg=Release|Any CPU
204-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91}.Proto|x86.ActiveCfg=Release|Any CPU
205-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91}.Release|Any CPU.ActiveCfg=Release|Any CPU
206-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91}.Release|Any CPU.Build.0=Release|Any CPU
207-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91}.Release|x86.ActiveCfg=Release|Any CPU
208-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91}.Release|x86.Build.0=Release|Any CPU
209199
{2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|Any CPU.ActiveCfg=Debug|Any CPU
210200
{2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|Any CPU.Build.0=Debug|Any CPU
211201
{2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|x86.ActiveCfg=Debug|Any CPU
@@ -245,7 +235,6 @@ Global
245235
{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5} ={CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
246236
{88E2D422-6852-46E3-A740-83E391DC7973} ={CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
247237
{4239EFEA-E746-446A-BF7A-51FCBAB13946} ={CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
248-
{BF5C6D92-D053-4216-9C42-B62F5F5C5E91} ={CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
249238
{2E60864A-E3FF-4BCC-810F-DC7C34E6B236} ={CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
250239
{BDA4D411-6AD9-4B3E-A3B3-07BAD6BEF1ED} ={CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
251240
EndGlobalSection

‎src/fsharp/CompileOps.fs‎

Lines changed: 110 additions & 122 deletions
Large diffs are not rendered by default.

‎src/fsharp/CompileOps.fsi‎

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -74,48 +74,53 @@ val ParseInput : (UnicodeLexing.Lexbuf -> Parser.token) * ErrorLogger * UnicodeL
7474
//--------------------------------------------------------------------------
7575

7676
/// Get the location associated with an error
77-
valGetRangeOfError:PhasedError-> range option
77+
valGetRangeOfDiagnostic:PhasedDiagnostic-> range option
7878

7979
/// Get the number associated with an error
80-
valGetErrorNumber:PhasedError-> int
80+
valGetDiagnosticNumber:PhasedDiagnostic-> int
8181

8282
/// Split errors into a"main" error and a set of associated errors
83-
valSplitRelatedErrors:PhasedError->PhasedError*PhasedError list
83+
valSplitRelatedDiagnostics:PhasedDiagnostic->PhasedDiagnostic*PhasedDiagnostic list
8484

8585
/// Output an error to a buffer
86-
valOutputPhasedError:ErrorLogger.ErrorStyle-> StringBuilder->PhasedError-> bool-> unit
86+
valOutputPhasedDiagnostic: ErrorStyle-> StringBuilder->PhasedDiagnostic-> isError: bool-> unit
8787

8888
/// Output an error or warning to a buffer
89-
valOutputErrorOrWarning: implicitIncludeDir:string* showFullPaths: bool* flattenErrors: bool* errorStyle: ErrorStyle*warning:bool-> StringBuilder->PhasedError-> unit
89+
valOutputDiagnostic: implicitIncludeDir:string* showFullPaths: bool* flattenErrors: bool* errorStyle: ErrorStyle*isError:bool-> StringBuilder->PhasedDiagnostic-> unit
9090

9191
/// Output extra context information for an error or warning to a buffer
92-
valOutputErrorOrWarningContext: prefix:string-> fileLineFunction:(string-> int-> string)-> StringBuilder->PhasedError-> unit
92+
valOutputDiagnosticContext: prefix:string-> fileLineFunction:(string-> int-> string)-> StringBuilder->PhasedDiagnostic-> unit
9393

94+
/// Part of LegacyHostedCompilerForTesting
9495
[<RequireQualifiedAccess>]
95-
typeErrorLocation=
96+
typeDiagnosticLocation=
9697
{ Range:range
9798
File:string
9899
TextRepresentation:string
99100
IsEmpty:bool}
100101

102+
/// Part of LegacyHostedCompilerForTesting
101103
[<RequireQualifiedAccess>]
102-
typeCanonicalInformation=
104+
typeDiagnosticCanonicalInformation=
103105
{ ErrorNumber:int
104106
Subcategory:string
105107
TextRepresentation:string}
106108

109+
/// Part of LegacyHostedCompilerForTesting
107110
[<RequireQualifiedAccess>]
108-
typeDetailedIssueInfo=
109-
{ Location:ErrorLocation option
110-
Canonical:CanonicalInformation
111+
typeDiagnosticDetailedInfo=
112+
{ Location:DiagnosticLocation option
113+
Canonical:DiagnosticCanonicalInformation
111114
Message:string}
112115

116+
/// Part of LegacyHostedCompilerForTesting
113117
[<RequireQualifiedAccess>]
114-
typeErrorOrWarning=
118+
typeDiagnostic=
115119
| Shortofbool*string
116-
| Longofbool*DetailedIssueInfo
120+
| Longofbool*DiagnosticDetailedInfo
117121

118-
valCollectErrorOrWarning:implicitIncludeDir:string* showFullPaths: bool* flattenErrors: bool* errorStyle: ErrorStyle* warning:bool* PhasedError-> seq<ErrorOrWarning>
122+
/// Part of LegacyHostedCompilerForTesting
123+
valCollectDiagnostic:implicitIncludeDir:string* showFullPaths: bool* flattenErrors: bool* errorStyle: ErrorStyle* warning:bool* PhasedDiagnostic-> seq<Diagnostic>
119124

120125
//----------------------------------------------------------------------------
121126
// Resolve assembly references
@@ -717,10 +722,10 @@ val TypeCheckOneInputAndFinishEventually :
717722
-> Eventually<(TcEnv* TopAttribs* TypedImplFile list)* TcState>
718723

719724
/// Indicates if we should report a warning
720-
val ReportWarning: globalWarnLevel: int* specificWarnOff: int list* specificWarnOn: int list->PhasedError-> bool
725+
val ReportWarning: globalWarnLevel: int* specificWarnOff: int list* specificWarnOn: int list->PhasedDiagnostic-> bool
721726

722727
/// Indicates if we should report a warning as an error
723-
val ReportWarningAsError: globalWarnLevel: int* specificWarnOff: int list* specificWarnOn: int list* specificWarnAsError: int list* specificWarnAsWarn: int list* globalWarnAsError: bool->PhasedError-> bool
728+
val ReportWarningAsError: globalWarnLevel: int* specificWarnOff: int list* specificWarnOn: int list* specificWarnAsError: int list* specificWarnAsWarn: int list* globalWarnAsError: bool->PhasedDiagnostic-> bool
724729

725730
//----------------------------------------------------------------------------
726731
//#load closure
@@ -732,6 +737,14 @@ type CodeContext =
732737
| Compilation
733738
| Editing
734739

740+
[<RequireQualifiedAccess>]
741+
typeLoadClosureInput=
742+
{ FileName:string
743+
SyntaxTree:ParsedInput option
744+
ParseDiagnostics:(PhasedDiagnostic* bool) list
745+
MetaCommandDiagnostics:(PhasedDiagnostic* bool) list}
746+
747+
735748
[<RequireQualifiedAccess>]
736749
typeLoadClosure=
737750
{/// The source files along with the ranges of the #load positions in each file.
@@ -740,26 +753,26 @@ type LoadClosure =
740753
/// The resolved references along with the ranges of the #r positions in each file.
741754
References:(string* AssemblyResolution list) list
742755

743-
/// The list of references that were not resolved during load closure. These may still be extension references.
756+
/// The list of references that were not resolved during load closure.
744757
UnresolvedReferences:UnresolvedAssemblyReference list
745758

746-
/// The list of all sources in the closure with inputs when available
747-
Inputs:(string* ParsedInput option* PhasedError list* PhasedError list) list
759+
/// The list of all sources in the closure with inputs when available, with associated parse errors and warnings
760+
Inputs:LoadClosureInput list
761+
762+
/// The original #load references, including those that didn't resolve
763+
OriginalLoadReferences:(range* string) list
748764

749765
/// The #nowarns
750766
NoWarns:(string* range list) list
751767

752-
/// Errors seen while processing resolutions
753-
ResolutionErrors:PhasedError list
754-
755-
/// Warnings seen while processing resolutions
756-
ResolutionWarnings:PhasedError list
768+
/// Diagnostics seen while processing resolutions
769+
ResolutionDiagnostics:(PhasedDiagnostic* bool) list
757770

758-
///*Parse* errors seen while parsingroot of closure
759-
RootErrors:PhasedError list
771+
///Diagnostics to show forroot of closure (used by fsc.fs)
772+
AllRootFileDiagnostics:(PhasedDiagnostic* bool) list
760773

761-
///*Parse* warningsseen whileparsing root of closure
762-
RootWarnings:PhasedErrorlist}
774+
///Diagnosticsseen whileprocessing the compiler options implied root of closure
775+
LoadClosureRootFileDiagnostics:(PhasedDiagnostic* bool)list}
763776

764777
// Used from service.fs, when editing a script file
765778
static memberComputeClosureOfSourceText:referenceResolver:ReferenceResolver.Resolver* filename: string* source: string* implicitDefines:CodeContext* useSimpleResolution: bool* useFsiAuxLib: bool* lexResourceManager: Lexhelp.LexResourceManager* applyCompilerOptions:(TcConfigBuilder-> unit)* assumeDotNetFramework: bool-> LoadClosure

‎src/fsharp/CompileOptions.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ let GetGeneratedILModuleName (t:CompilerTarget) (s:string) =
13501350

13511351
letignoreFailureOnMono1_1_16 f=try f()with_->()
13521352

1353-
letDoWithErrorColorisWarn f=
1353+
letDoWithErrorColorisError f=
13541354
ifnot enableConsoleColoringthen
13551355
f()
13561356
else
@@ -1367,7 +1367,7 @@ let DoWithErrorColor isWarn f =
13671367
try
13681368
letwarnColor=if Console.BackgroundColor= ConsoleColor.Whitethen ConsoleColor.DarkBlueelse ConsoleColor.Cyan
13691369
leterrorColor= ConsoleColor.Red
1370-
ignoreFailureOnMono1_1_16(fun()-> Console.ForegroundColor<-(ifisWarnthenwarnColorelseerrorColor))
1370+
ignoreFailureOnMono1_1_16(fun()-> Console.ForegroundColor<-(ifisErrorthenerrorColorelsewarnColor))
13711371
f()
13721372
finally
13731373
ignoreFailureOnMono1_1_16(fun()-> Console.ForegroundColor<- c)

‎src/fsharp/CompileOptions.fsi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ val NormalizeAssemblyRefs : TcImports -> (AbstractIL.IL.ILScopeRef -> AbstractIL
9292
// Miscellany
9393
val ignoreFailureOnMono1_1_16:(unit-> unit)-> unit
9494
val mutable enableConsoleColoring: bool
95-
val DoWithErrorColor: bool->(unit-> 'a)-> 'a
95+
val DoWithErrorColor:isError:bool->(unit-> 'a)-> 'a
9696
val ReportTime: TcConfig-> string-> unit
9797
val GetAbbrevFlagSet: TcConfigBuilder-> bool-> Set<string>
9898
val PostProcessCompilerArgs: string Set-> string[]-> string list

‎src/fsharp/ErrorLogger.fs‎

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,10 @@ module BuildPhaseSubcategory =
176176
letInternal="internal"// Compiler ICE
177177

178178
[<System.Diagnostics.DebuggerDisplay("{DebugDisplay()}")>]
179-
typePhasedError={ Exception:exn; Phase:BuildPhase}with
179+
typePhasedDiagnostic=
180+
{ Exception:exn; Phase:BuildPhase}
180181
/// Construct a phased error
181-
static memberCreate(exn:exn,phase:BuildPhase):PhasedError=
182+
static memberCreate(exn:exn,phase:BuildPhase):PhasedDiagnostic=
182183
System.Diagnostics.Debug.Assert(phase<>BuildPhase.DefaultPhase, sprintf"Compile error seen with no phase to attribute it to.%A%s%s" phase exn.Message exn.StackTrace)
183184
{Exception= exn; Phase=phase}
184185
memberthis.DebugDisplay()=
@@ -236,9 +237,9 @@ type PhasedError = { Exception:exn; Phase:BuildPhase } with
236237
// Sanity check ensures that Phase matches Subcategory
237238
#if DEBUG
238239
if isPhaseInCompilethen
239-
System.Diagnostics.Debug.Assert(PhasedError.IsSubcategoryOfCompile(pe.Subcategory()),"Subcategory did not match isPhaesInCompile=true")
240+
System.Diagnostics.Debug.Assert(PhasedDiagnostic.IsSubcategoryOfCompile(pe.Subcategory()),"Subcategory did not match isPhaesInCompile=true")
240241
else
241-
System.Diagnostics.Debug.Assert(not(PhasedError.IsSubcategoryOfCompile(pe.Subcategory())),"Subcategory did not match isPhaseInCompile=false")
242+
System.Diagnostics.Debug.Assert(not(PhasedDiagnostic.IsSubcategoryOfCompile(pe.Subcategory())),"Subcategory did not match isPhaseInCompile=false")
242243
#endif
243244
isPhaseInCompile
244245

@@ -248,39 +249,33 @@ type ErrorLogger(nameForDebugging:string) =
248249
abstractErrorCount:int
249250
// The 'Impl' factoring enables a developer to place a breakpoint at the non-Impl
250251
// code just below and get a breakpoint for all error logger implementations.
251-
abstractWarnSinkImpl:PhasedError->unit
252-
abstractErrorSinkImpl:PhasedError->unit
253-
memberthis.WarnSink err=
254-
this.WarnSinkImpl err
255-
memberthis.ErrorSink err=
256-
this.ErrorSinkImpl err
252+
abstractDiagnosticSink: phasedError:PhasedDiagnostic* isError:bool->unit
257253
memberthis.DebugDisplay()= sprintf"ErrorLogger(%s)" nameForDebugging
258-
// Record the reported error/warning numbers for SQM purpose
259-
abstractErrorNumbers :intlist
260-
abstractWarningNumbers :intlist
261-
defaultthis.ErrorNumbers=[]
262-
defaultthis.WarningNumbers=[]
263254

264255
letDiscardErrorsLogger=
265256
{new ErrorLogger("DiscardErrorsLogger")with
266-
memberx.WarnSinkImpl(e)=
267-
()
268-
memberx.ErrorSinkImpl(e)=
269-
()
270-
memberx.ErrorCount=
271-
0}
257+
memberx.DiagnosticSink(phasedError,isError)=()
258+
memberx.ErrorCount=0}
272259

273260
letAssertFalseErrorLogger=
274261
{new ErrorLogger("AssertFalseErrorLogger")with
275-
memberx.WarnSinkImpl(e)=
276-
assertfalse;()
277-
memberx.ErrorSinkImpl(e)=
278-
assertfalse;()
279-
memberx.ErrorCount=
280-
assertfalse;0}
262+
memberx.DiagnosticSink(phasedError,isError)=assertfalse;()
263+
memberx.ErrorCount=assertfalse;0}
264+
265+
typeCapturingErrorLogger(nm)=
266+
inherit ErrorLogger(nm)
267+
let mutableerrorCount=0
268+
letdiagnostics= ResizeArray()
269+
overridex.DiagnosticSink(phasedError,isError)=
270+
if isErrorthen errorCount<- errorCount+1
271+
diagnostics.Add(phasedError, isError)
272+
overridex.ErrorCount= errorCount
273+
memberx.Diagnostics= diagnostics|> Seq.toList
274+
memberx.CommitDelayedDiagnostics(errorLogger:ErrorLogger)=
275+
// Eagerly grab all the errors and warnings from the mutable collection
276+
leterrors= diagnostics.ToArray()
277+
errors|> Array.iter errorLogger.DiagnosticSink
281278

282-
/// When no errorLogger is installed (on the thread) use this one.
283-
letuninitializedErrorLoggerFallback= ref AssertFalseErrorLogger
284279

285280
/// Type holds thread-static globals for use by the compile.
286281
typeinternalCompileThreadStatic=
@@ -301,7 +296,7 @@ type internal CompileThreadStatic =
301296
static memberErrorLogger
302297
with get()=
303298
match box CompileThreadStatic.errorLoggerwith
304-
|null->!uninitializedErrorLoggerFallback
299+
|null->AssertFalseErrorLogger
305300
|_-> CompileThreadStatic.errorLogger
306301
andset v= CompileThreadStatic.errorLogger<- v
307302

@@ -343,15 +338,30 @@ module ErrorLoggerExtensions =
343338
#endif
344339

345340
typeErrorLoggerwith
346-
memberx.ErrorR exn=match exnwith StopProcessing| ReportedError_-> raise exn|_-> x.ErrorSink(PhasedError.Create(exn,CompileThreadStatic.BuildPhase))
347-
memberx.Warning exn=match exnwith StopProcessing| ReportedError_-> raise exn|_-> x.WarnSink(PhasedError.Create(exn,CompileThreadStatic.BuildPhase))
348-
memberx.Error exn= x.ErrorR exn; raise(ReportedError(Some exn))
349-
memberx.PhasedError(ph:PhasedError)=
350-
x.ErrorSink ph
341+
342+
memberx.ErrorR exn=
343+
match exnwith
344+
| StopProcessing
345+
| ReportedError_-> raise exn
346+
|_-> x.DiagnosticSink(PhasedDiagnostic.Create(exn,CompileThreadStatic.BuildPhase),true)
347+
348+
memberx.Warning exn=
349+
match exnwith
350+
| StopProcessing
351+
| ReportedError_-> raise exn
352+
|_-> x.DiagnosticSink(PhasedDiagnostic.Create(exn,CompileThreadStatic.BuildPhase),false)
353+
354+
memberx.Error exn=
355+
x.ErrorR exn
356+
raise(ReportedError(Some exn))
357+
358+
memberx.SimulateError(ph:PhasedDiagnostic)=
359+
x.DiagnosticSink(ph,true)
351360
raise(ReportedError(Some ph.Exception))
361+
352362
memberx.ErrorRecovery(exn:exn)(m:range)=
353363
// Never throws ReportedError.
354-
// Throws StopProcessing and exceptions raised by theErrorSink(exn) handler.
364+
// Throws StopProcessing and exceptions raised by theDiagnosticSink(exn) handler.
355365
match exnwith
356366
(* Don't send ThreadAbortException down the error channel*)
357367
#if FX_REDUCED_EXCEPTIONS
@@ -370,13 +380,13 @@ module ErrorLoggerExtensions =
370380
// Do standard error recovery.
371381
// Additionally ignore/catch StopProcessing. [This is the only catch handler for StopProcessing].
372382
// Additionally ignore/catch ReportedError.
373-
// Can throw other exceptions raised by theErrorSink(exn) handler.
383+
// Can throw other exceptions raised by theDiagnosticSink(exn) handler.
374384
match exnwith
375385
| StopProcessing| WrappedError(StopProcessing,_)->()// suppress, so skip error recovery.
376386
|_->
377387
try x.ErrorRecovery exn m
378388
with
379-
| StopProcessing| WrappedError(StopProcessing,_)->()// catch, e.g. raised byErrorSink.
389+
| StopProcessing| WrappedError(StopProcessing,_)->()// catch, e.g. raised byDiagnosticSink.
380390
| ReportedError_| WrappedError(ReportedError_,_)->()// catch, but not expected unless ErrorRecovery is changed.
381391
memberx.ErrorRecoveryNoRange(exn:exn)=
382392
x.ErrorRecovery exn range0
@@ -395,8 +405,7 @@ let PushErrorLoggerPhaseUntilUnwind(errorLoggerTransformer : ErrorLogger -> #Err
395405
letnewInstalled= reftrue
396406
letnewIsInstalled()=if!newInstalledthen()else(assertfalse;();(*failwith "error logger used after unwind"*))// REVIEW: ok to throw?
397407
letchkErrorLogger={new ErrorLogger("PushErrorLoggerPhaseUntilUnwind")with
398-
memberx.WarnSinkImpl(e)= newIsInstalled(); newErrorLogger.WarnSink(e)
399-
memberx.ErrorSinkImpl(e)= newIsInstalled(); newErrorLogger.ErrorSink(e)
408+
memberx.DiagnosticSink(phasedError,isError)= newIsInstalled(); newErrorLogger.DiagnosticSink(phasedError, isError)
400409
memberx.ErrorCount= newIsInstalled(); newErrorLogger.ErrorCount}
401410
CompileThreadStatic.ErrorLogger<- chkErrorLogger
402411
{new System.IDisposablewith
@@ -406,17 +415,17 @@ let PushErrorLoggerPhaseUntilUnwind(errorLoggerTransformer : ErrorLogger -> #Err
406415

407416
letSetThreadBuildPhaseNoUnwind(phase:BuildPhase)= CompileThreadStatic.BuildPhase<- phase
408417
letSetThreadErrorLoggerNoUnwind(errorLogger)= CompileThreadStatic.ErrorLogger<- errorLogger
409-
letSetUninitializedErrorLoggerFallback errLogger= uninitializedErrorLoggerFallback:= errLogger
410418

411419
// Global functions are still used by parser and TAST ops.
412420
leterrorR exn= CompileThreadStatic.ErrorLogger.ErrorR exn
413421
letwarning exn= CompileThreadStatic.ErrorLogger.Warning exn
414422
leterror exn= CompileThreadStatic.ErrorLogger.Error exn
415423
// for test only
416-
letphasedError(p:PhasedError)= CompileThreadStatic.ErrorLogger.PhasedError p
424+
letsimulateError(p:PhasedDiagnostic)= CompileThreadStatic.ErrorLogger.SimulateError p
417425

418-
leterrorSink pe= CompileThreadStatic.ErrorLogger.ErrorSink pe
419-
letwarnSink pe= CompileThreadStatic.ErrorLogger.WarnSink pe
426+
letdiagnosticSink(phasedError,isError)= CompileThreadStatic.ErrorLogger.DiagnosticSink(phasedError, isError)
427+
leterrorSink pe= diagnosticSink(pe,true)
428+
letwarnSink pe= diagnosticSink(pe,false)
420429
leterrorRecovery exn m= CompileThreadStatic.ErrorLogger.ErrorRecovery exn m
421430
letstopProcessingRecovery exn m= CompileThreadStatic.ErrorLogger.StopProcessingRecovery exn m
422431
leterrorRecoveryNoRange exn= CompileThreadStatic.ErrorLogger.ErrorRecoveryNoRange exn
@@ -439,8 +448,7 @@ let suppressErrorReporting f =
439448
try
440449
leterrorLogger=
441450
{new ErrorLogger("suppressErrorReporting")with
442-
memberx.WarnSinkImpl(_exn)=()
443-
memberx.ErrorSinkImpl(_exn)=()
451+
memberx.DiagnosticSink(_phasedError,_isError)=()
444452
memberx.ErrorCount=0}
445453
SetThreadErrorLoggerNoUnwind(errorLogger)
446454
f()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp