From 676ed3ead7ad905e9e75940172d5357df55bc99c Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Mon, 6 May 2019 17:17:24 +0200 Subject: [PATCH 1/2] parseProjectReferenceConfigFile: always set SourceFile.path --- src/compiler/program.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 6f7ffc2c3a972..b493a90d3f919 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2699,11 +2699,12 @@ namespace ts { projectReferenceRedirects.set(sourceFilePath, false); return undefined; } - sourceFile.path = sourceFilePath; - sourceFile.resolvedPath = sourceFilePath; - sourceFile.originalFileName = refPath; commandLine = parseJsonSourceFileConfigFileContent(sourceFile, configParsingHost, basePath, /*existingOptions*/ undefined, refPath); } + sourceFile.path = sourceFilePath; + sourceFile.resolvedPath = sourceFilePath; + sourceFile.originalFileName = refPath; + const resolvedRef: ResolvedProjectReference = { commandLine, sourceFile }; projectReferenceRedirects.set(sourceFilePath, resolvedRef); if (commandLine.projectReferences) { From 3c2f36890821cbd49149ba6b21580d898ab7760b Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Mon, 6 May 2019 21:31:20 +0200 Subject: [PATCH 2/2] add assert --- src/compiler/program.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index b493a90d3f919..6f331bb49ca1b 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2688,6 +2688,7 @@ namespace ts { return undefined; } sourceFile = Debug.assertDefined(commandLine.options.configFile); + Debug.assert(!sourceFile.path || sourceFile.path === sourceFilePath); addFileToFilesByName(sourceFile, sourceFilePath, /*redirectedPath*/ undefined); } else {