@@ -204,14 +204,15 @@ export function createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax:
204
204
205
205
function createDiagnosticExplainingFile ( program : Program , file : SourceFile | undefined , fileProcessingReason : FileIncludeReason | undefined , diagnostic : DiagnosticMessage , args : DiagnosticArguments ) : Diagnostic {
206
206
let seenReasons : Set < FileIncludeReason > | undefined ;
207
- const reasons = file && fileReasons . get ( file . path ) ;
208
207
let fileIncludeReasons : DiagnosticMessageChain [ ] | undefined ;
209
208
let relatedInfo : DiagnosticWithLocation [ ] | undefined ;
210
- let locationReason = isReferencedFile ( fileProcessingReason ) ? fileProcessingReason : undefined ;
211
209
let fileIncludeReasonDetails : DiagnosticMessageChain | undefined ;
212
210
let redirectInfo : DiagnosticMessageChain [ ] | undefined ;
213
- let cachedChain = file && fileReasonsToChain ?. get ( file . path ) ;
214
211
let chain : DiagnosticMessageChain | undefined ;
212
+
213
+ const reasons = file && fileReasons . get ( file . path ) ;
214
+ let locationReason = isReferencedFile ( fileProcessingReason ) ? fileProcessingReason : undefined ;
215
+ let cachedChain = file && fileReasonsToChain ?. get ( file . path ) ;
215
216
if ( cachedChain ) {
216
217
if ( cachedChain . fileIncludeReasonDetails ) {
217
218
seenReasons = new Set ( reasons ) ;
@@ -235,7 +236,7 @@ export function createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax:
235
236
236
237
if ( seenReasons && cachedChain ) {
237
238
if ( cachedChain . details && ! processedExtraReason ) {
238
- chain = chainDiagnosticMessages ( cachedChain . details , diagnostic , ...args || emptyArray ) ;
239
+ chain = chainDiagnosticMessages ( cachedChain . details , diagnostic , ...args ?? emptyArray ) ;
239
240
}
240
241
else if ( cachedChain . fileIncludeReasonDetails ) {
241
242
if ( ! processedExtraReason ) {
0 commit comments