mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Allows emitting buildInfo when --noEmit is specified (#39122)
* Some tests * Allow noEmit with incremental and composite Fixes #38440
This commit is contained in:
@@ -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 ?
|
||||
|
||||
+25
-10
@@ -1029,6 +1029,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)
|
||||
@@ -32057,13 +32063,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((<FunctionLikeDeclaration>node).body)) {
|
||||
if (languageVersion >= ScriptTarget.ES2015 || !hasRestParameter(node) || node.flags & NodeFlags.Ambient || nodeIsMissing((<FunctionLikeDeclaration>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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -32133,13 +32139,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;
|
||||
}
|
||||
|
||||
@@ -32156,13 +32162,13 @@ namespace ts {
|
||||
const parent = getDeclarationContainer(node);
|
||||
if (parent.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(<SourceFile>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;
|
||||
}
|
||||
|
||||
@@ -32175,7 +32181,7 @@ namespace ts {
|
||||
const parent = getDeclarationContainer(node);
|
||||
if (parent.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(<SourceFile>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));
|
||||
}
|
||||
}
|
||||
@@ -32393,7 +32399,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);
|
||||
}
|
||||
}
|
||||
@@ -38316,7 +38322,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);
|
||||
}
|
||||
@@ -38336,7 +38342,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 {
|
||||
@@ -38446,6 +38452,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)) {
|
||||
|
||||
@@ -462,7 +462,6 @@ namespace ts {
|
||||
{
|
||||
name: "noEmit",
|
||||
type: "boolean",
|
||||
affectsEmit: true,
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Basic_Options,
|
||||
description: Diagnostics.Do_not_emit_outputs,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+17
-9
@@ -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
|
||||
@@ -3278,7 +3274,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;
|
||||
@@ -3287,11 +3283,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) {
|
||||
@@ -3657,7 +3654,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
|
||||
@@ -3684,6 +3687,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;
|
||||
|
||||
@@ -5525,6 +5525,7 @@ namespace ts {
|
||||
reportsUnnecessary?: {};
|
||||
source?: string;
|
||||
relatedInformation?: DiagnosticRelatedInformation[];
|
||||
/* @internal */ skippedOn?: keyof CompilerOptions;
|
||||
}
|
||||
|
||||
export interface DiagnosticRelatedInformation {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 }),
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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"]
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1266
File diff suppressed because it is too large
Load Diff
+1193
File diff suppressed because it is too large
Load Diff
+810
@@ -0,0 +1,810 @@
|
||||
Input::
|
||||
//// [/lib/lib.d.ts]
|
||||
/// <reference no-default-lib="true"/>
|
||||
interface Boolean {}
|
||||
interface Function {}
|
||||
interface CallableFunction {}
|
||||
interface NewableFunction {}
|
||||
interface IArguments {}
|
||||
interface Number { toExponential: any; }
|
||||
interface Object {}
|
||||
interface RegExp {}
|
||||
interface String { charAt: any; }
|
||||
interface Array<T> { length: number; [n: number]: T; }
|
||||
interface ReadonlyArray<T> {}
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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
|
||||
[96msrc/project/src/noChangeFileWithEmitSpecificError.ts[0m:[93m1[0m:[93m19[0m - [91merror[0m[90m TS2396: [0mDuplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
||||
|
||||
[7m1[0m function someFunc(arguments: boolean, ...rest: any[]) {
|
||||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m
|
||||
|
||||
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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
|
||||
[96msrc/project/src/directUse.ts[0m:[93m2[0m:[93m28[0m - [91merror[0m[90m TS2551: [0mProperty 'prop' does not exist on type 'classC'. Did you mean 'prop1'?
|
||||
|
||||
[7m2[0m new indirectClass().classC.prop;
|
||||
[7m [0m [91m ~~~~[0m
|
||||
|
||||
[96msrc/project/src/class.ts[0m:[93m2[0m:[93m5[0m
|
||||
[7m2[0m prop1 = 1;
|
||||
[7m [0m [96m ~~~~~[0m
|
||||
'prop1' is declared here.
|
||||
|
||||
[96msrc/project/src/indirectUse.ts[0m:[93m2[0m:[93m28[0m - [91merror[0m[90m TS2551: [0mProperty 'prop' does not exist on type 'classC'. Did you mean 'prop1'?
|
||||
|
||||
[7m2[0m new indirectClass().classC.prop;
|
||||
[7m [0m [91m ~~~~[0m
|
||||
|
||||
[96msrc/project/src/class.ts[0m:[93m2[0m:[93m5[0m
|
||||
[7m2[0m prop1 = 1;
|
||||
[7m [0m [96m ~~~~~[0m
|
||||
'prop1' is declared here.
|
||||
|
||||
[96msrc/project/src/noChangeFileWithEmitSpecificError.ts[0m:[93m1[0m:[93m19[0m - [91merror[0m[90m TS2396: [0mDuplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
||||
|
||||
[7m1[0m function someFunc(arguments: boolean, ...rest: any[]) {
|
||||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m
|
||||
|
||||
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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
|
||||
[96msrc/project/src/noChangeFileWithEmitSpecificError.ts[0m:[93m1[0m:[93m19[0m - [91merror[0m[90m TS2396: [0mDuplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
||||
|
||||
[7m1[0m function someFunc(arguments: boolean, ...rest: any[]) {
|
||||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m
|
||||
|
||||
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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"
|
||||
}
|
||||
|
||||
+815
@@ -0,0 +1,815 @@
|
||||
Input::
|
||||
//// [/lib/lib.d.ts]
|
||||
/// <reference no-default-lib="true"/>
|
||||
interface Boolean {}
|
||||
interface Function {}
|
||||
interface CallableFunction {}
|
||||
interface NewableFunction {}
|
||||
interface IArguments {}
|
||||
interface Number { toExponential: any; }
|
||||
interface Object {}
|
||||
interface RegExp {}
|
||||
interface String { charAt: any; }
|
||||
interface Array<T> { length: number; [n: number]: T; }
|
||||
interface ReadonlyArray<T> {}
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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
|
||||
[96msrc/project/src/noChangeFileWithEmitSpecificError.ts[0m:[93m1[0m:[93m19[0m - [91merror[0m[90m TS2396: [0mDuplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
||||
|
||||
[7m1[0m function someFunc(arguments: boolean, ...rest: any[]) {
|
||||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m
|
||||
|
||||
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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
|
||||
[96msrc/project/src/directUse.ts[0m:[93m2[0m:[93m28[0m - [91merror[0m[90m TS2551: [0mProperty 'prop' does not exist on type 'classC'. Did you mean 'prop1'?
|
||||
|
||||
[7m2[0m new indirectClass().classC.prop;
|
||||
[7m [0m [91m ~~~~[0m
|
||||
|
||||
[96msrc/project/src/class.ts[0m:[93m2[0m:[93m5[0m
|
||||
[7m2[0m prop1 = 1;
|
||||
[7m [0m [96m ~~~~~[0m
|
||||
'prop1' is declared here.
|
||||
|
||||
[96msrc/project/src/indirectUse.ts[0m:[93m2[0m:[93m28[0m - [91merror[0m[90m TS2551: [0mProperty 'prop' does not exist on type 'classC'. Did you mean 'prop1'?
|
||||
|
||||
[7m2[0m new indirectClass().classC.prop;
|
||||
[7m [0m [91m ~~~~[0m
|
||||
|
||||
[96msrc/project/src/class.ts[0m:[93m2[0m:[93m5[0m
|
||||
[7m2[0m prop1 = 1;
|
||||
[7m [0m [96m ~~~~~[0m
|
||||
'prop1' is declared here.
|
||||
|
||||
[96msrc/project/src/noChangeFileWithEmitSpecificError.ts[0m:[93m1[0m:[93m19[0m - [91merror[0m[90m TS2396: [0mDuplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
||||
|
||||
[7m1[0m function someFunc(arguments: boolean, ...rest: any[]) {
|
||||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m
|
||||
|
||||
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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
|
||||
[96msrc/project/src/noChangeFileWithEmitSpecificError.ts[0m:[93m1[0m:[93m19[0m - [91merror[0m[90m TS2396: [0mDuplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
||||
|
||||
[7m1[0m function someFunc(arguments: boolean, ...rest: any[]) {
|
||||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m
|
||||
|
||||
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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"
|
||||
}
|
||||
|
||||
+755
@@ -0,0 +1,755 @@
|
||||
Input::
|
||||
//// [/lib/lib.d.ts]
|
||||
/// <reference no-default-lib="true"/>
|
||||
interface Boolean {}
|
||||
interface Function {}
|
||||
interface CallableFunction {}
|
||||
interface NewableFunction {}
|
||||
interface IArguments {}
|
||||
interface Number { toExponential: any; }
|
||||
interface Object {}
|
||||
interface RegExp {}
|
||||
interface String { charAt: any; }
|
||||
interface Array<T> { length: number; [n: number]: T; }
|
||||
interface ReadonlyArray<T> {}
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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
|
||||
[96msrc/project/src/noChangeFileWithEmitSpecificError.ts[0m:[93m1[0m:[93m19[0m - [91merror[0m[90m TS2396: [0mDuplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
||||
|
||||
[7m1[0m function someFunc(arguments: boolean, ...rest: any[]) {
|
||||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m
|
||||
|
||||
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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
|
||||
[96msrc/project/src/directUse.ts[0m:[93m2[0m:[93m28[0m - [91merror[0m[90m TS2551: [0mProperty 'prop' does not exist on type 'classC'. Did you mean 'prop1'?
|
||||
|
||||
[7m2[0m new indirectClass().classC.prop;
|
||||
[7m [0m [91m ~~~~[0m
|
||||
|
||||
[96msrc/project/src/class.ts[0m:[93m2[0m:[93m5[0m
|
||||
[7m2[0m prop1 = 1;
|
||||
[7m [0m [96m ~~~~~[0m
|
||||
'prop1' is declared here.
|
||||
|
||||
[96msrc/project/src/indirectUse.ts[0m:[93m2[0m:[93m28[0m - [91merror[0m[90m TS2551: [0mProperty 'prop' does not exist on type 'classC'. Did you mean 'prop1'?
|
||||
|
||||
[7m2[0m new indirectClass().classC.prop;
|
||||
[7m [0m [91m ~~~~[0m
|
||||
|
||||
[96msrc/project/src/class.ts[0m:[93m2[0m:[93m5[0m
|
||||
[7m2[0m prop1 = 1;
|
||||
[7m [0m [96m ~~~~~[0m
|
||||
'prop1' is declared here.
|
||||
|
||||
[96msrc/project/src/noChangeFileWithEmitSpecificError.ts[0m:[93m1[0m:[93m19[0m - [91merror[0m[90m TS2396: [0mDuplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
||||
|
||||
[7m1[0m function someFunc(arguments: boolean, ...rest: any[]) {
|
||||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m
|
||||
|
||||
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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
|
||||
[96msrc/project/src/noChangeFileWithEmitSpecificError.ts[0m:[93m1[0m:[93m19[0m - [91merror[0m[90m TS2396: [0mDuplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
||||
|
||||
[7m1[0m function someFunc(arguments: boolean, ...rest: any[]) {
|
||||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m
|
||||
|
||||
|
||||
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-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
|
||||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\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"
|
||||
}
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
Input::
|
||||
//// [/lib/lib.d.ts]
|
||||
/// <reference no-default-lib="true"/>
|
||||
interface Boolean {}
|
||||
interface Function {}
|
||||
interface CallableFunction {}
|
||||
interface NewableFunction {}
|
||||
interface IArguments {}
|
||||
interface Number { toExponential: any; }
|
||||
interface Object {}
|
||||
interface RegExp {}
|
||||
interface String { charAt: any; }
|
||||
interface Array<T> { length: number; [n: number]: T; }
|
||||
interface ReadonlyArray<T> {}
|
||||
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
|
||||
[96msrc/project/tsconfig.json[0m:[93m1[0m:[93m16[0m - [91merror[0m[90m TS6310: [0mReferenced project '/src/utils' may not disable emit.
|
||||
|
||||
[7m1[0m {"references":[{"path":"../utils"}]}
|
||||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~[0m
|
||||
|
||||
|
||||
Found 1 error.
|
||||
|
||||
exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated
|
||||
|
||||
|
||||
//// [/src/project/index.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user