diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 5f3bc171bb525..44bf1fbea623c 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -5,6 +5,7 @@ namespace ts { reportsUnnecessary?: {}; source?: string; relatedInformation?: ReusableDiagnosticRelatedInformation[]; + skippedOn?: keyof CompilerOptions; } export interface ReusableDiagnosticRelatedInformation { @@ -268,6 +269,7 @@ namespace ts { const result: Diagnostic = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath); result.reportsUnnecessary = diagnostic.reportsUnnecessary; result.source = diagnostic.source; + result.skippedOn = diagnostic.skippedOn; const { relatedInformation } = diagnostic; result.relatedInformation = relatedInformation ? relatedInformation.length ? @@ -676,7 +678,7 @@ namespace ts { const cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path); // Report the bind and check diagnostics from the cache if we already have those diagnostics present if (cachedDiagnostics) { - return cachedDiagnostics; + return filterSemanticDiagnotics(cachedDiagnostics, state.compilerOptions); } } @@ -685,7 +687,7 @@ namespace ts { if (state.semanticDiagnosticsPerFile) { state.semanticDiagnosticsPerFile.set(path, diagnostics); } - return diagnostics; + return filterSemanticDiagnotics(diagnostics, state.compilerOptions); } export type ProgramBuildInfoDiagnostic = string | [string, readonly ReusableDiagnostic[]]; @@ -816,6 +818,7 @@ namespace ts { const result: ReusableDiagnostic = convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo); result.reportsUnnecessary = diagnostic.reportsUnnecessary; result.source = diagnostic.source; + result.skippedOn = diagnostic.skippedOn; const { relatedInformation } = diagnostic; result.relatedInformation = relatedInformation ? relatedInformation.length ? diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 93b2834178eec..7988383da3d19 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1013,6 +1013,12 @@ namespace ts { } } + function errorSkippedOn(key: keyof CompilerOptions, location: Node | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): Diagnostic { + const diagnostic = error(location, message, arg0, arg1, arg2, arg3); + diagnostic.skippedOn = key; + return diagnostic; + } + function error(location: Node | undefined, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): Diagnostic { const diagnostic = location ? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) @@ -32030,13 +32036,13 @@ namespace ts { function checkCollisionWithArgumentsInGeneratedCode(node: SignatureDeclaration) { // no rest parameters \ declaration context \ overload - no codegen impact - if (languageVersion >= ScriptTarget.ES2015 || compilerOptions.noEmit || !hasRestParameter(node) || node.flags & NodeFlags.Ambient || nodeIsMissing((node).body)) { + if (languageVersion >= ScriptTarget.ES2015 || !hasRestParameter(node) || node.flags & NodeFlags.Ambient || nodeIsMissing((node).body)) { return; } forEach(node.parameters, p => { if (p.name && !isBindingPattern(p.name) && p.name.escapedText === argumentsSymbol.escapedName) { - error(p, Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); + errorSkippedOn("noEmit", p, Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); } }); } @@ -32106,13 +32112,13 @@ namespace ts { function checkWeakMapCollision(node: Node) { const enclosingBlockScope = getEnclosingBlockScopeContainer(node); if (getNodeCheckFlags(enclosingBlockScope) & NodeCheckFlags.ContainsClassWithPrivateIdentifiers) { - error(node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, "WeakMap"); + errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, "WeakMap"); } } function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: Identifier) { // No need to check for require or exports for ES6 modules and later - if (moduleKind >= ModuleKind.ES2015 || compilerOptions.noEmit) { + if (moduleKind >= ModuleKind.ES2015) { return; } @@ -32129,13 +32135,13 @@ namespace ts { const parent = getDeclarationContainer(node); if (parent.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords - error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, + errorSkippedOn("noEmit", name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, declarationNameToString(name), declarationNameToString(name)); } } function checkCollisionWithGlobalPromiseInGeneratedCode(node: Node, name: Identifier): void { - if (languageVersion >= ScriptTarget.ES2017 || compilerOptions.noEmit || !needCollisionCheckForIdentifier(node, name, "Promise")) { + if (languageVersion >= ScriptTarget.ES2017 || !needCollisionCheckForIdentifier(node, name, "Promise")) { return; } @@ -32148,7 +32154,7 @@ namespace ts { const parent = getDeclarationContainer(node); if (parent.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(parent) && parent.flags & NodeFlags.HasAsyncFunctions) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. - error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, + errorSkippedOn("noEmit", name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, declarationNameToString(name), declarationNameToString(name)); } } @@ -32366,7 +32372,7 @@ namespace ts { } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); - if (!compilerOptions.noEmit && languageVersion < ScriptTarget.ESNext && needCollisionCheckForIdentifier(node, node.name, "WeakMap")) { + if (languageVersion < ScriptTarget.ESNext && needCollisionCheckForIdentifier(node, node.name, "WeakMap")) { potentialWeakMapCollisions.push(node); } } @@ -38267,7 +38273,7 @@ namespace ts { const moduleKind = getEmitModuleKind(compilerOptions); - if (moduleKind < ModuleKind.ES2015 && moduleKind !== ModuleKind.System && !compilerOptions.noEmit && + if (moduleKind < ModuleKind.ES2015 && moduleKind !== ModuleKind.System && !(node.parent.parent.flags & NodeFlags.Ambient) && hasSyntacticModifier(node.parent.parent, ModifierFlags.Export)) { checkESModuleMarker(node.name); } @@ -38287,7 +38293,7 @@ namespace ts { function checkESModuleMarker(name: Identifier | BindingPattern): boolean { if (name.kind === SyntaxKind.Identifier) { if (idText(name) === "__esModule") { - return grammarErrorOnNode(name, Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); + return grammarErrorOnNodeSkippedOn("noEmit", name, Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); } } else { @@ -38397,6 +38403,15 @@ namespace ts { return false; } + function grammarErrorOnNodeSkippedOn(key: keyof CompilerOptions, node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + const sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + errorSkippedOn(key, node, message, arg0, arg1, arg2); + return true; + } + return false; + } + function grammarErrorOnNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { const sourceFile = getSourceFileOfNode(node); if (!hasParseDiagnostics(sourceFile)) { diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index f217bae5c1006..e93b9741d45bc 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -462,7 +462,6 @@ namespace ts { { name: "noEmit", type: "boolean", - affectsEmit: true, showInSimplifiedHelpView: true, category: Diagnostics.Basic_Options, description: Diagnostics.Do_not_emit_outputs, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e863de12537d6..d49603f368685 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4458,6 +4458,10 @@ "category": "Error", "code": 6309 }, + "Referenced project '{0}' may not disable emit.": { + "category": "Error", + "code": 6310 + }, "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'": { "category": "Message", "code": 6350 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index afbcb53f81612..aa520167afb8e 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -333,7 +333,7 @@ namespace ts { // Write build information if applicable if (!buildInfoPath || targetSourceFile || emitSkipped) return; const program = host.getProgramBuildInfo(); - if (host.isEmitBlocked(buildInfoPath) || compilerOptions.noEmit) { + if (host.isEmitBlocked(buildInfoPath)) { emitSkipped = true; return; } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 8cd92ddd285cd..64867d2038652 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1719,7 +1719,7 @@ namespace ts { function getSemanticDiagnosticsForFile(sourceFile: SourceFile, cancellationToken: CancellationToken | undefined): readonly Diagnostic[] { return concatenate( - getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken), + filterSemanticDiagnotics(getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken), options), getProgramDiagnostics(sourceFile) ); } @@ -3011,10 +3011,6 @@ namespace ts { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)); } - if (!options.listFilesOnly && options.noEmit && isIncrementalCompilation(options)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", options.incremental ? "incremental" : "composite"); - } - verifyProjectReferences(); // List of collected files is complete; validate exhautiveness if this is a project with a file list @@ -3269,7 +3265,7 @@ namespace ts { } function verifyProjectReferences() { - const buildInfoPath = !options.noEmit && !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : undefined; + const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : undefined; forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, index, parent) => { const ref = (parent ? parent.commandLine.projectReferences : projectReferences)![index]; const parentFile = parent && parent.sourceFile as JsonSourceFile; @@ -3278,11 +3274,12 @@ namespace ts { return; } const options = resolvedRef.commandLine.options; - if (!options.composite) { + if (!options.composite || options.noEmit) { // ok to not have composite if the current program is container only const inputs = parent ? parent.commandLine.fileNames : rootNames; if (inputs.length) { - createDiagnosticForReference(parentFile, index, Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.path); + if (!options.composite) createDiagnosticForReference(parentFile, index, Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.path); + if (options.noEmit) createDiagnosticForReference(parentFile, index, Diagnostics.Referenced_project_0_may_not_disable_emit, ref.path); } } if (ref.prepend) { @@ -3648,7 +3645,13 @@ namespace ts { cancellationToken: CancellationToken | undefined ): EmitResult | undefined { const options = program.getCompilerOptions(); - if (options.noEmit) return emitSkippedWithNoDiagnostics; + if (options.noEmit) { + // Cache the semantic diagnostics + program.getSemanticDiagnostics(sourceFile, cancellationToken); + return sourceFile || outFile(options) ? + emitSkippedWithNoDiagnostics : + program.emitBuildInfo(writeFile, cancellationToken); + } // If the noEmitOnError flag is set, then check if we have any errors so far. If so, // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we @@ -3675,6 +3678,11 @@ namespace ts { return { diagnostics, sourceMaps: undefined, emittedFiles, emitSkipped: true }; } + /*@internal*/ + export function filterSemanticDiagnotics(diagnostic: readonly Diagnostic[], option: CompilerOptions): readonly Diagnostic[] { + return filter(diagnostic, d => !d.skippedOn || !option[d.skippedOn]); + } + /*@internal*/ interface CompilerHostLike { useCaseSensitiveFileNames(): boolean; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 5c4e6f0c1592b..30efd1c68f970 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5522,6 +5522,7 @@ namespace ts { reportsUnnecessary?: {}; source?: string; relatedInformation?: DiagnosticRelatedInformation[]; + /* @internal */ skippedOn?: keyof CompilerOptions; } export interface DiagnosticRelatedInformation { diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index 9f9143f6a3985..2fcca3613d1ed 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -296,9 +296,9 @@ interface Symbol { } else if (actualText !== expectedText) { // Verify build info without affectedFilesPendingEmit - const { text: actualBuildInfoText, affectedFilesPendingEmit: actualAffectedFilesPendingEmit } = getBuildInfoWithoutAffectedFilesPendingEmit(actualText); - const { text: expectedBuildInfoText, affectedFilesPendingEmit: expectedAffectedFilesPendingEmit } = getBuildInfoWithoutAffectedFilesPendingEmit(expectedText); - assert.equal(actualBuildInfoText, expectedBuildInfoText, `TsBuild info text without affectedFilesPendingEmit: ${outputFile}::\nIncremental buildInfoText:: ${actualText}\nClean buildInfoText:: ${expectedText}`); + const { buildInfo: actualBuildInfo, affectedFilesPendingEmit: actualAffectedFilesPendingEmit } = getBuildInfoForIncrementalCorrectnessCheck(actualText); + const { buildInfo: expectedBuildInfo, affectedFilesPendingEmit: expectedAffectedFilesPendingEmit } = getBuildInfoForIncrementalCorrectnessCheck(expectedText); + assert.deepEqual(actualBuildInfo, expectedBuildInfo, `TsBuild info text without affectedFilesPendingEmit: ${outputFile}::\nIncremental buildInfoText:: ${actualText}\nClean buildInfoText:: ${expectedText}`); // Verify that incrementally pending affected file emit are in clean build since clean build can contain more files compared to incremental depending of noEmitOnError option if (actualAffectedFilesPendingEmit) { assert.isDefined(expectedAffectedFilesPendingEmit, `Incremental build contains affectedFilesPendingEmit, clean build should also have it: ${outputFile}::\nIncremental buildInfoText:: ${actualText}\nClean buildInfoText:: ${expectedText}`); @@ -314,15 +314,19 @@ interface Symbol { }); } - function getBuildInfoWithoutAffectedFilesPendingEmit(text: string | undefined): { text: string | undefined; affectedFilesPendingEmit?: ProgramBuildInfo["affectedFilesPendingEmit"]; } { + function getBuildInfoForIncrementalCorrectnessCheck(text: string | undefined): { buildInfo: BuildInfo | undefined; affectedFilesPendingEmit?: ProgramBuildInfo["affectedFilesPendingEmit"]; } { const buildInfo = text ? getBuildInfo(text) : undefined; - if (!buildInfo?.program?.affectedFilesPendingEmit) return { text }; - const { program: { affectedFilesPendingEmit, ...programRest }, ...rest } = buildInfo; + if (!buildInfo?.program) return { buildInfo }; + // Ignore noEmit since that shouldnt be reason to emit the tsbuild info and presence of it in the buildinfo file does not matter + const { program: { affectedFilesPendingEmit, options: { noEmit, ...optionsRest}, ...programRest }, ...rest } = buildInfo; return { - text: getBuildInfoText({ + buildInfo: { ...rest, - program: programRest - }), + program: { + options: optionsRest, + ...programRest + } + }, affectedFilesPendingEmit }; } @@ -423,7 +427,7 @@ interface Symbol { subScenario, baseFs, newSys, - commandLineArgs, + commandLineArgs: incrementalCommandLineArgs || commandLineArgs, incrementalModifyFs, modifyFs, tick @@ -515,12 +519,12 @@ interface Symbol { })); }); describe("incremental correctness", () => { - incrementalScenarios.forEach((_, index) => verifyIncrementalCorrectness(() => ({ + incrementalScenarios.forEach(({ commandLineArgs: incrementalCommandLineArgs }, index) => verifyIncrementalCorrectness(() => ({ scenario, subScenario, baseFs, newSys: incrementalSys[index], - commandLineArgs, + commandLineArgs: incrementalCommandLineArgs || commandLineArgs, incrementalModifyFs: fs => { for (let i = 0; i <= index; i++) { incrementalScenarios[i].modifyFs(fs); diff --git a/src/testRunner/unittests/tsc/incremental.ts b/src/testRunner/unittests/tsc/incremental.ts index b231b439858dc..fd42ccddf1843 100644 --- a/src/testRunner/unittests/tsc/incremental.ts +++ b/src/testRunner/unittests/tsc/incremental.ts @@ -116,5 +116,124 @@ const a: string = "hello";`, "utf-8"), const a: string = 10;`, "utf-8"), ); }); + + describe("when noEmit changes between compilation", () => { + verifyNoEmitChanges({ incremental: true }); + verifyNoEmitChanges({ incremental: true, declaration: true }); + verifyNoEmitChanges({ composite: true }); + + function verifyNoEmitChanges(compilerOptions: CompilerOptions) { + const noChangeRunWithNoEmit: TscIncremental = { + subScenario: "No Change run with noEmit", + commandLineArgs: ["--p", "src/project", "--noEmit"], + ...noChangeRun, + }; + const noChangeRunWithEmit: TscIncremental = { + subScenario: "No Change run with emit", + commandLineArgs: ["--p", "src/project"], + ...noChangeRun, + }; + let optionsString = ""; + for (const key in compilerOptions) { + if (hasProperty(compilerOptions, key)) { + optionsString += ` ${key}`; + } + } + + verifyTscSerializedIncrementalEdits({ + scenario: "incremental", + subScenario: `noEmit changes${optionsString}`, + commandLineArgs: ["--p", "src/project"], + fs, + incrementalScenarios: [ + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + { + subScenario: "Introduce error but still noEmit", + commandLineArgs: ["--p", "src/project", "--noEmit"], + modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + buildKind: BuildKind.IncrementalDtsChange + }, + { + subScenario: "Fix error and emit", + modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + buildKind: BuildKind.IncrementalDtsChange + }, + noChangeRunWithEmit, + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + noChangeRunWithEmit, + { + subScenario: "Introduce error and emit", + modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + buildKind: BuildKind.IncrementalDtsChange + }, + noChangeRunWithEmit, + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + noChangeRunWithEmit, + { + subScenario: "Fix error and no emit", + commandLineArgs: ["--p", "src/project", "--noEmit"], + modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + buildKind: BuildKind.IncrementalDtsChange + }, + noChangeRunWithEmit, + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + noChangeRunWithEmit, + ], + }); + + verifyTscSerializedIncrementalEdits({ + scenario: "incremental", + subScenario: `noEmit changes with initial noEmit${optionsString}`, + commandLineArgs: ["--p", "src/project", "--noEmit"], + fs, + incrementalScenarios: [ + noChangeRunWithEmit, + { + subScenario: "Introduce error with emit", + commandLineArgs: ["--p", "src/project"], + modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + buildKind: BuildKind.IncrementalDtsChange + }, + { + subScenario: "Fix error and no emit", + modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + buildKind: BuildKind.IncrementalDtsChange + }, + noChangeRunWithEmit, + ], + }); + + function fs() { + return loadProjectFromFiles({ + "/src/project/src/class.ts": Utils.dedent` + export class classC { + prop = 1; + }`, + "/src/project/src/indirectClass.ts": Utils.dedent` + import { classC } from './class'; + export class indirectClass { + classC = new classC(); + }`, + "/src/project/src/directUse.ts": Utils.dedent` + import { indirectClass } from './indirectClass'; + new indirectClass().classC.prop;`, + "/src/project/src/indirectUse.ts": Utils.dedent` + import { indirectClass } from './indirectClass'; + new indirectClass().classC.prop;`, + "/src/project/src/noChangeFile.ts": Utils.dedent` + export function writeLog(s: string) { + }`, + "/src/project/src/noChangeFileWithEmitSpecificError.ts": Utils.dedent` + function someFunc(arguments: boolean, ...rest: any[]) { + }`, + "/src/project/tsconfig.json": JSON.stringify({ compilerOptions }), + }); + } + } + }); }); } diff --git a/src/testRunner/unittests/tsc/projectReferences.ts b/src/testRunner/unittests/tsc/projectReferences.ts index 06e68018dd6ce..765bdfdb53cf1 100644 --- a/src/testRunner/unittests/tsc/projectReferences.ts +++ b/src/testRunner/unittests/tsc/projectReferences.ts @@ -17,5 +17,26 @@ namespace ts { }), commandLineArgs: ["--p", "src/project"], }); + + verifyTsc({ + scenario: "projectReferences", + subScenario: "when project references composite project with noEmit", + fs: () => loadProjectFromFiles({ + "/src/utils/index.ts": "export const x = 10;", + "/src/utils/tsconfig.json": JSON.stringify({ + compilerOptions: { + composite: true, + noEmit: true, + } + }), + "/src/project/index.ts": `import { x } from "../utils";`, + "/src/project/tsconfig.json": JSON.stringify({ + references: [ + { path: "../utils" } + ] + }), + }), + commandLineArgs: ["--p", "src/project"] + }); }); } diff --git a/src/testRunner/unittests/tscWatch/incremental.ts b/src/testRunner/unittests/tscWatch/incremental.ts index d8a61636e141b..b8bc2d33eb260 100644 --- a/src/testRunner/unittests/tscWatch/incremental.ts +++ b/src/testRunner/unittests/tscWatch/incremental.ts @@ -194,7 +194,8 @@ namespace ts.tscWatch { messageText: "Type 'number' is not assignable to type 'string'.", relatedInformation: undefined, reportsUnnecessary: undefined, - source: undefined + source: undefined, + skippedOn: undefined, }]); }); }); diff --git a/tests/baselines/reference/noEmitAndComposite.errors.txt b/tests/baselines/reference/noEmitAndComposite.errors.txt deleted file mode 100644 index fe6de6ae441ac..0000000000000 --- a/tests/baselines/reference/noEmitAndComposite.errors.txt +++ /dev/null @@ -1,19 +0,0 @@ -/tsconfig.json(3,9): error TS5053: Option 'noEmit' cannot be specified with option 'composite'. -/tsconfig.json(4,9): error TS5053: Option 'noEmit' cannot be specified with option 'composite'. - - -==== /tsconfig.json (2 errors) ==== - { - "compilerOptions": { - "noEmit": true, - ~~~~~~~~ -!!! error TS5053: Option 'noEmit' cannot be specified with option 'composite'. - "composite": true - ~~~~~~~~~~~ -!!! error TS5053: Option 'noEmit' cannot be specified with option 'composite'. - } - } - -==== /a.ts (0 errors) ==== - const x = 10; - \ No newline at end of file diff --git a/tests/baselines/reference/noEmitAndIncremental.errors.txt b/tests/baselines/reference/noEmitAndIncremental.errors.txt deleted file mode 100644 index c257e9ba5402f..0000000000000 --- a/tests/baselines/reference/noEmitAndIncremental.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -/tsconfig.json(3,9): error TS5053: Option 'noEmit' cannot be specified with option 'incremental'. -/tsconfig.json(4,9): error TS5053: Option 'noEmit' cannot be specified with option 'incremental'. - - -==== /tsconfig.json (2 errors) ==== - { - "compilerOptions": { - "noEmit": true, - ~~~~~~~~ -!!! error TS5053: Option 'noEmit' cannot be specified with option 'incremental'. - "incremental": true - ~~~~~~~~~~~~~ -!!! error TS5053: Option 'noEmit' cannot be specified with option 'incremental'. - } - } - - -==== /a.ts (0 errors) ==== - const x = 10; - \ No newline at end of file diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-composite.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-composite.js new file mode 100644 index 0000000000000..b9393ff3f07b6 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-composite.js @@ -0,0 +1,1260 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{"compilerOptions":{"composite":true}} + + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +exports.__esModule = true; +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +exports.__esModule = true; +exports.writeLog = void 0; +function writeLog(s) { +} +exports.writeLog = writeLog; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc --p src/project --noEmit +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + [ + "./src/directuse.ts", + [ + { + "file": "./src/directuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/indirectclass.ts", + [ + "./src/indirectuse.ts", + [ + { + "file": "./src/indirectuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/directuse.ts", + 0 + ], + [ + "./src/indirectclass.ts", + 1 + ], + [ + "./src/indirectuse.ts", + 0 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] file written with same contents +//// [/src/project/src/class.js] file written with same contents +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + [ + "./src/directuse.ts", + [ + { + "file": "./src/directuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/indirectclass.ts", + [ + "./src/indirectuse.ts", + [ + { + "file": "./src/indirectuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/directuse.ts", + 0 + ], + [ + "./src/indirectclass.ts", + 1 + ], + [ + "./src/indirectuse.ts", + 0 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental-declaration.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental-declaration.js new file mode 100644 index 0000000000000..557af80a87bf8 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental-declaration.js @@ -0,0 +1,1266 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{"compilerOptions":{"incremental":true,"declaration":true}} + + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +exports.__esModule = true; +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +exports.__esModule = true; +exports.writeLog = void 0; +function writeLog(s) { +} +exports.writeLog = writeLog; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc --p src/project --noEmit +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + [ + "./src/directuse.ts", + [ + { + "file": "./src/directuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/indirectclass.ts", + [ + "./src/indirectuse.ts", + [ + { + "file": "./src/indirectuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/directuse.ts", + 0 + ], + [ + "./src/indirectclass.ts", + 1 + ], + [ + "./src/indirectuse.ts", + 0 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] file written with same contents +//// [/src/project/src/class.js] file written with same contents +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + [ + "./src/directuse.ts", + [ + { + "file": "./src/directuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/indirectclass.ts", + [ + "./src/indirectuse.ts", + [ + { + "file": "./src/indirectuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/directuse.ts", + 0 + ], + [ + "./src/indirectclass.ts", + 1 + ], + [ + "./src/indirectuse.ts", + 0 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental.js new file mode 100644 index 0000000000000..2c210ce4758d6 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental.js @@ -0,0 +1,1193 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{"compilerOptions":{"incremental":true}} + + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.js] +"use strict"; +exports.__esModule = true; +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +exports.__esModule = true; +exports.writeLog = void 0; +function writeLog(s) { +} +exports.writeLog = writeLog; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc --p src/project --noEmit +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + [ + "./src/directuse.ts", + [ + { + "file": "./src/directuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/indirectclass.ts", + [ + "./src/indirectuse.ts", + [ + { + "file": "./src/indirectuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/indirectclass.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.js] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + [ + "./src/directuse.ts", + [ + { + "file": "./src/directuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/indirectclass.ts", + [ + "./src/indirectuse.ts", + [ + { + "file": "./src/indirectuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/indirectclass.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-composite.js new file mode 100644 index 0000000000000..75d42a6e6c103 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-composite.js @@ -0,0 +1,810 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{"compilerOptions":{"composite":true}} + + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/directuse.ts", + 1 + ], + [ + "./src/indirectclass.ts", + 1 + ], + [ + "./src/indirectuse.ts", + 1 + ], + [ + "./src/nochangefile.ts", + 1 + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +exports.__esModule = true; +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +exports.__esModule = true; +exports.writeLog = void 0; +function writeLog(s) { +} +exports.writeLog = writeLog; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + [ + "./src/directuse.ts", + [ + { + "file": "./src/directuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/indirectclass.ts", + [ + "./src/indirectuse.ts", + [ + { + "file": "./src/indirectuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/directuse.ts", + 0 + ], + [ + "./src/indirectclass.ts", + 1 + ], + [ + "./src/indirectuse.ts", + 0 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental-declaration.js new file mode 100644 index 0000000000000..767f6b30912a9 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental-declaration.js @@ -0,0 +1,815 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{"compilerOptions":{"incremental":true,"declaration":true}} + + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/directuse.ts", + 1 + ], + [ + "./src/indirectclass.ts", + 1 + ], + [ + "./src/indirectuse.ts", + 1 + ], + [ + "./src/nochangefile.ts", + 1 + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +exports.__esModule = true; +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +exports.__esModule = true; +exports.writeLog = void 0; +function writeLog(s) { +} +exports.writeLog = writeLog; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + [ + "./src/directuse.ts", + [ + { + "file": "./src/directuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/indirectclass.ts", + [ + "./src/indirectuse.ts", + [ + { + "file": "./src/indirectuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/directuse.ts", + 0 + ], + [ + "./src/indirectclass.ts", + 1 + ], + [ + "./src/indirectuse.ts", + 0 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental.js new file mode 100644 index 0000000000000..a1824d46678dc --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental.js @@ -0,0 +1,755 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{"compilerOptions":{"incremental":true}} + + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/directuse.ts", + 1 + ], + [ + "./src/indirectclass.ts", + 1 + ], + [ + "./src/indirectuse.ts", + 1 + ], + [ + "./src/nochangefile.ts", + 1 + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.js] +"use strict"; +exports.__esModule = true; +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +exports.__esModule = true; +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +exports.__esModule = true; +exports.writeLog = void 0; +function writeLog(s) { +} +exports.writeLog = writeLog; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc --p src/project +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + [ + "./src/directuse.ts", + [ + { + "file": "./src/directuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/indirectclass.ts", + [ + "./src/indirectuse.ts", + [ + { + "file": "./src/indirectuse.ts", + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc --p src/project --noEmit +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "noEmit": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + 1 + ], + [ + "./src/indirectclass.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc --p src/project +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/class.js] +"use strict"; +exports.__esModule = true; +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n", + "affectsGlobalScope": false + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "exportedModulesMap": { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/directuse.ts", + "./src/indirectclass.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "file": "./src/nochangefilewithemitspecificerror.ts", + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-references-composite-project-with-noEmit.js b/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-references-composite-project-with-noEmit.js new file mode 100644 index 0000000000000..fbdfa2fa4d2d0 --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-references-composite-project-with-noEmit.js @@ -0,0 +1,48 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/index.ts] +import { x } from "../utils"; + +//// [/src/project/tsconfig.json] +{"references":[{"path":"../utils"}]} + +//// [/src/utils/index.ts] + + +//// [/src/utils/tsconfig.json] +{"compilerOptions":{"composite":true,"noEmit":true}} + + + +Output:: +/lib/tsc --p src/project +src/project/tsconfig.json:1:16 - error TS6310: Referenced project '/src/utils' may not disable emit. + +1 {"references":[{"path":"../utils"}]} +   ~~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/index.js] +"use strict"; +exports.__esModule = true; + +