Merge remote-tracking branch 'origin' into release-3.4

This commit is contained in:
Daniel Rosenwasser
2019-03-13 11:07:28 -07:00
104 changed files with 2293 additions and 249 deletions
-10
View File
@@ -454,16 +454,6 @@ task("baseline-accept").description = "Makes the most recent test results the ne
task("baseline-accept-rwc", () => baselineAccept(localRwcBaseline, refRwcBaseline));
task("baseline-accept-rwc").description = "Makes the most recent rwc test results the new baseline, overwriting the old baseline";
// TODO(rbuckton): Determine if 'webhost' is still in use.
const buildWebHost = () => buildProject("tests/webhost/webtsc.tsconfig.json");
task("webhost", series(lkgPreBuild, buildWebHost));
task("webhost").description = "Builds the tsc web host";
const cleanWebHost = () => cleanProject("tests/webhost/webtsc.tsconfig.json");
cleanTasks.push(cleanWebHost);
task("clean-webhost", cleanWebHost);
task("clean-webhost").description = "Cleans the outputs of the tsc web host";
const buildLoggedIO = async () => {
mkdirp.sync("built/local/temp");
await exec(process.execPath, ["lib/tsc", "--types", "--target", "es5", "--lib", "es5", "--outdir", "built/local/temp", "src/harness/loggedIO.ts"]);
+19 -6
View File
@@ -403,13 +403,15 @@ namespace ts {
messageNeedsName = false;
}
if (symbol.declarations && symbol.declarations.length) {
let multipleDefaultExports = false;
if (length(symbol.declarations)) {
// If the current node is a default export of some sort, then check if
// there are any other default exports that we need to error on.
// We'll know whether we have other default exports depending on if `symbol` already has a declaration list set.
if (isDefaultExport) {
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
messageNeedsName = false;
multipleDefaultExports = true;
}
else {
// This is to properly report an error in the case "export default { }" is after export default of class declaration or function declaration.
@@ -420,15 +422,26 @@ namespace ts {
(node.kind === SyntaxKind.ExportAssignment && !(<ExportAssignment>node).isExportEquals)) {
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
messageNeedsName = false;
multipleDefaultExports = true;
}
}
}
const addError = (decl: Declaration): void => {
file.bindDiagnostics.push(createDiagnosticForNode(getNameOfDeclaration(decl) || decl, message, messageNeedsName ? getDisplayName(decl) : undefined));
};
forEach(symbol.declarations, addError);
addError(node);
const declarationName = getNameOfDeclaration(node) || node;
const relatedInformation: DiagnosticRelatedInformation[] = [];
forEach(symbol.declarations, (declaration, index) => {
const decl = getNameOfDeclaration(declaration) || declaration;
const diag = createDiagnosticForNode(decl, message, messageNeedsName ? getDisplayName(declaration) : undefined);
file.bindDiagnostics.push(
multipleDefaultExports ? addRelatedInfo(diag, createDiagnosticForNode(declarationName, index === 0 ? Diagnostics.Another_export_default_is_here : Diagnostics.and_here)) : diag
);
if (multipleDefaultExports) {
relatedInformation.push(createDiagnosticForNode(decl, Diagnostics.The_first_export_default_is_here));
}
});
const diag = createDiagnosticForNode(declarationName, message, messageNeedsName ? getDisplayName(node) : undefined);
file.bindDiagnostics.push(multipleDefaultExports ? addRelatedInfo(diag, ...relatedInformation) : diag);
symbol = createSymbol(SymbolFlags.None, name);
}
+65 -28
View File
@@ -792,14 +792,6 @@ namespace ts {
}
}
function addRelatedInfo(diagnostic: Diagnostic, ...relatedInformation: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]]) {
if (!diagnostic.relatedInformation) {
diagnostic.relatedInformation = [];
}
diagnostic.relatedInformation.push(...relatedInformation);
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)
@@ -7034,13 +7026,23 @@ namespace ts {
getUnionType([info1.type, info2.type]), info1.isReadonly || info2.isReadonly);
}
function includeMixinType(type: Type, types: ReadonlyArray<Type>, index: number): Type {
function findMixins(types: ReadonlyArray<Type>): ReadonlyArray<boolean> {
const constructorTypeCount = countWhere(types, (t) => getSignaturesOfType(t, SignatureKind.Construct).length > 0);
const mixinFlags = map(types, isMixinConstructorType);
if (constructorTypeCount > 0 && constructorTypeCount === countWhere(mixinFlags, (b) => b)) {
const firstMixinIndex = mixinFlags.indexOf(/*searchElement*/ true);
mixinFlags[firstMixinIndex] = false;
}
return mixinFlags;
}
function includeMixinType(type: Type, types: ReadonlyArray<Type>, mixinFlags: ReadonlyArray<boolean>, index: number): Type {
const mixedTypes: Type[] = [];
for (let i = 0; i < types.length; i++) {
if (i === index) {
mixedTypes.push(type);
}
else if (isMixinConstructorType(types[i])) {
else if (mixinFlags[i]) {
mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType(types[i], SignatureKind.Construct)[0]));
}
}
@@ -7055,7 +7057,8 @@ namespace ts {
let stringIndexInfo: IndexInfo | undefined;
let numberIndexInfo: IndexInfo | undefined;
const types = type.types;
const mixinCount = countWhere(types, isMixinConstructorType);
const mixinFlags = findMixins(types);
const mixinCount = countWhere(mixinFlags, (b) => b);
for (let i = 0; i < types.length; i++) {
const t = type.types[i];
// When an intersection type contains mixin constructor types, the construct signatures from
@@ -7063,12 +7066,12 @@ namespace ts {
// other construct signatures in the intersection type. For example, the intersection type
// '{ new(...args: any[]) => A } & { new(s: string) => B }' has a single construct signature
// 'new(s: string) => A & B'.
if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(t)) {
if (!mixinFlags[i]) {
let signatures = getSignaturesOfType(t, SignatureKind.Construct);
if (signatures.length && mixinCount > 0) {
signatures = map(signatures, s => {
const clone = cloneSignature(s);
clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, i);
clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, mixinFlags, i);
return clone;
});
}
@@ -10025,13 +10028,17 @@ namespace ts {
// that substitutes the index type for P. For example, for an index access { [P in K]: Box<T[P]> }[X], we
// construct the type Box<T[X]>.
if (isGenericMappedType(objectType)) {
const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]);
const templateMapper = combineTypeMappers(objectType.mapper, mapper);
return type.simplified = mapType(instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper), getSimplifiedType);
return type.simplified = mapType(substituteIndexedMappedType(objectType, type.indexType), getSimplifiedType);
}
return type.simplified = type;
}
function substituteIndexedMappedType(objectType: MappedType, index: Type) {
const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);
const templateMapper = combineTypeMappers(objectType.mapper, mapper);
return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper);
}
function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression, missingType = accessNode ? errorType : unknownType): Type {
if (objectType === wildcardType || indexType === wildcardType) {
return wildcardType;
@@ -17839,7 +17846,15 @@ namespace ts {
function getTypeOfPropertyOfContextualType(type: Type, name: __String) {
return mapType(type, t => {
if (t.flags & TypeFlags.StructuredType) {
if (isGenericMappedType(t)) {
const constraint = getConstraintTypeFromMappedType(t);
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
const propertyNameType = getLiteralType(unescapeLeadingUnderscores(name));
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
return substituteIndexedMappedType(t, propertyNameType);
}
}
else if (t.flags & TypeFlags.StructuredType) {
const prop = getPropertyOfType(t, name);
if (prop) {
return getTypeOfSymbol(prop);
@@ -20511,7 +20526,13 @@ namespace ts {
argCount--;
}
let spanArray: NodeArray<Node>;
let related: DiagnosticWithLocation | undefined;
const error = hasRestParameter || hasSpreadArgument ? hasRestParameter && hasSpreadArgument ? Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more :
hasRestParameter ? Diagnostics.Expected_at_least_0_arguments_but_got_1 :
Diagnostics.Expected_0_arguments_but_got_1_or_more : Diagnostics.Expected_0_arguments_but_got_1;
if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) {
const paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount];
if (paramDecl) {
@@ -20522,17 +20543,33 @@ namespace ts {
);
}
}
if (hasRestParameter || hasSpreadArgument) {
const error = hasRestParameter && hasSpreadArgument ? Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more :
hasRestParameter ? Diagnostics.Expected_at_least_0_arguments_but_got_1 :
Diagnostics.Expected_0_arguments_but_got_1_or_more;
const diagnostic = createDiagnosticForNode(node, error, paramRange, argCount);
return related ? addRelatedInfo(diagnostic, related) : diagnostic;
}
if (min < argCount && argCount < max) {
return createDiagnosticForNode(node, Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, argCount, belowArgCount, aboveArgCount);
}
const diagnostic = createDiagnosticForNode(node, Diagnostics.Expected_0_arguments_but_got_1, paramRange, argCount);
if (!hasSpreadArgument && argCount < min) {
const diagnostic = createDiagnosticForNode(node, error, paramRange, argCount);
return related ? addRelatedInfo(diagnostic, related) : diagnostic;
}
if (hasRestParameter || hasSpreadArgument) {
spanArray = createNodeArray(args);
if (hasSpreadArgument && argCount) {
const nextArg = elementAt(args, getSpreadArgumentIndex(args) + 1) || undefined;
spanArray = createNodeArray(args.slice(max > argCount && nextArg ? args.indexOf(nextArg) : max));
}
}
else {
spanArray = createNodeArray(args.slice(max));
}
spanArray.pos = first(spanArray).pos;
spanArray.end = last(spanArray).end;
if (spanArray.end === spanArray.pos) {
spanArray.end++;
}
const diagnostic = createDiagnosticForNodeArray(
getSourceFileOfNode(node), spanArray, error, paramRange, argCount);
return related ? addRelatedInfo(diagnostic, related) : diagnostic;
}
@@ -21100,12 +21137,11 @@ namespace ts {
const firstBase = baseTypes[0];
if (firstBase.flags & TypeFlags.Intersection) {
const types = (firstBase as IntersectionType).types;
const mixinCount = countWhere(types, isMixinConstructorType);
const mixinFlags = findMixins(types);
let i = 0;
for (const intersectionMember of (firstBase as IntersectionType).types) {
i++;
// We want to ignore mixin ctors
if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(intersectionMember)) {
if (!mixinFlags[i]) {
if (getObjectFlags(intersectionMember) & (ObjectFlags.Class | ObjectFlags.Interface)) {
if (intersectionMember.symbol === target) {
return true;
@@ -21115,6 +21151,7 @@ namespace ts {
}
}
}
i++;
}
return false;
}
+8
View File
@@ -2593,6 +2593,14 @@
"category": "Error",
"code": 2751
},
"The first export default is here.": {
"category": "Error",
"code": 2752
},
"Another export default is here.": {
"category": "Error",
"code": 2753
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
+10 -5
View File
@@ -825,11 +825,16 @@ namespace ts {
}
if (rootNames.length) {
for (const parsedRef of resolvedProjectReferences) {
if (parsedRef) {
const out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out;
if (out) {
const dtsOutfile = changeExtension(out, ".d.ts");
processSourceFile(dtsOutfile, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined);
if (!parsedRef) continue;
const out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out;
if (out) {
processSourceFile(changeExtension(out, ".d.ts"), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined);
}
else if (getEmitModuleKind(parsedRef.commandLine.options) === ModuleKind.None) {
for (const fileName of parsedRef.commandLine.fileNames) {
if (!fileExtensionIs(fileName, Extension.Dts) && hasTSFileExtension(fileName)) {
processSourceFile(getOutputDeclarationFileName(fileName, parsedRef.commandLine), /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined);
}
}
}
}
+23 -4
View File
@@ -9,12 +9,31 @@ namespace ts {
return result.diagnostics;
}
function hasInternalAnnotation(range: CommentRange, currentSourceFile: SourceFile) {
const comment = currentSourceFile.text.substring(range.pos, range.end);
return stringContains(comment, "@internal");
}
export function isInternalDeclaration(node: Node, currentSourceFile: SourceFile) {
const parseTreeNode = getParseTreeNode(node);
if (parseTreeNode && parseTreeNode.kind === SyntaxKind.Parameter) {
const paramIdx = (parseTreeNode.parent as FunctionLike).parameters.indexOf(parseTreeNode as ParameterDeclaration);
const previousSibling = paramIdx > 0 ? (parseTreeNode.parent as FunctionLike).parameters[paramIdx - 1] : undefined;
const text = currentSourceFile.text;
const commentRanges = previousSibling
? concatenate(
// to handle
// ... parameters, /* @internal */
// public param: string
getTrailingCommentRanges(text, skipTrivia(text, previousSibling.end + 1, /* stopAfterLineBreak */ false, /* stopAtComments */ true)),
getLeadingCommentRanges(text, node.pos)
)
: getTrailingCommentRanges(text, skipTrivia(text, node.pos, /* stopAfterLineBreak */ false, /* stopAtComments */ true));
return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile);
}
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile);
return !!forEach(leadingCommentRanges, range => {
const comment = currentSourceFile.text.substring(range.pos, range.end);
return stringContains(comment, "@internal");
return hasInternalAnnotation(range, currentSourceFile);
});
}
@@ -1075,8 +1094,8 @@ namespace ts {
let parameterProperties: ReadonlyArray<PropertyDeclaration> | undefined;
if (ctor) {
const oldDiag = getSymbolAccessibilityDiagnostic;
parameterProperties = compact(flatMap(ctor.parameters, param => {
if (!hasModifier(param, ModifierFlags.ParameterPropertyModifier)) return;
parameterProperties = compact(flatMap(ctor.parameters, (param) => {
if (!hasModifier(param, ModifierFlags.ParameterPropertyModifier) || shouldStripInternal(param)) return;
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(param);
if (param.name.kind === SyntaxKind.Identifier) {
return preserveJsDoc(createProperty(
+24 -9
View File
@@ -1012,9 +1012,9 @@ namespace ts {
return;
}
const buildResult = status.type === UpToDateStatusType.OutOfDateWithPrepend ?
updateBundle(resolved) : // Fake that files have been built by manipulating prepend and existing output
buildSingleProject(resolved); // Actual build
const buildResult = needsBuild(status, resolved) ?
buildSingleProject(resolved) : // Actual build
updateBundle(resolved); // Fake that files have been built by manipulating prepend and existing output
if (buildResult & BuildResultFlags.AnyErrors) return;
const { referencingProjectsMap, buildQueue } = getGlobalDependencyGraph();
@@ -1199,7 +1199,7 @@ namespace ts {
// Update time stamps for rest of the outputs
newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(configFile, newestDeclarationFileContentChangedTime, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
const status: UpToDateStatus = {
const status: Status.UpToDate = {
type: UpToDateStatusType.UpToDate,
newestDeclarationFileContentChangedTime: anyDtsChanged ? maximumDate : newestDeclarationFileContentChangedTime,
oldestOutputFileName: outputFiles.length ? outputFiles[0].name : getFirstProjectOutput(configFile)
@@ -1275,7 +1275,7 @@ namespace ts {
// Update timestamps for dts
const newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(config, minimumDate, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
const status: UpToDateStatus = {
const status: Status.UpToDate = {
type: UpToDateStatusType.UpToDate,
newestDeclarationFileContentChangedTime,
oldestOutputFileName: outputFiles[0].name
@@ -1292,7 +1292,12 @@ namespace ts {
return reportStatus(Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath!);
}
const priorNewestUpdateTime = updateOutputTimestampsWorker(proj, minimumDate, Diagnostics.Updating_output_timestamps_of_project_0);
projectStatus.setValue(proj.options.configFilePath as ResolvedConfigFilePath, { type: UpToDateStatusType.UpToDate, newestDeclarationFileContentChangedTime: priorNewestUpdateTime } as UpToDateStatus);
const status: Status.UpToDate = {
type: UpToDateStatusType.UpToDate,
newestDeclarationFileContentChangedTime: priorNewestUpdateTime,
oldestOutputFileName: getFirstProjectOutput(proj)
};
projectStatus.setValue(proj.options.configFilePath as ResolvedConfigFilePath, status);
}
function updateOutputTimestampsWorker(proj: ParsedCommandLine, priorNewestUpdateTime: Date, verboseMessage: DiagnosticMessage, skipOutputs?: FileMap<true>) {
@@ -1424,9 +1429,10 @@ namespace ts {
continue;
}
const buildResult = status.type === UpToDateStatusType.OutOfDateWithPrepend && !options.force ?
updateBundle(next) : // Fake that files have been built by manipulating prepend and existing output
buildSingleProject(next); // Actual build
const buildResult = needsBuild(status, next) ?
buildSingleProject(next) : // Actual build
updateBundle(next); // Fake that files have been built by manipulating prepend and existing output
anyFailed = anyFailed || !!(buildResult & BuildResultFlags.AnyErrors);
}
reportErrorSummary();
@@ -1440,6 +1446,15 @@ namespace ts {
return anyFailed ? ExitStatus.DiagnosticsPresent_OutputsSkipped : ExitStatus.Success;
}
function needsBuild(status: UpToDateStatus, configFile: ResolvedConfigFileName) {
if (status.type !== UpToDateStatusType.OutOfDateWithPrepend || options.force) return true;
const config = parseConfigFile(configFile);
return !config ||
config.fileNames.length === 0 ||
!!config.errors.length ||
!isIncrementalCompilation(config.options);
}
function reportParseConfigFileDiagnostic(proj: ResolvedConfigFileName) {
reportAndStoreErrors(proj, [configFileCache.getValue(proj) as Diagnostic]);
}
+8
View File
@@ -8516,6 +8516,14 @@ namespace ts {
return arr.slice(index);
}
export function addRelatedInfo<T extends Diagnostic>(diagnostic: T, ...relatedInformation: DiagnosticRelatedInformation[]): T {
if (!diagnostic.relatedInformation) {
diagnostic.relatedInformation = [];
}
diagnostic.relatedInformation.push(...relatedInformation);
return diagnostic;
}
export function minAndMax<T>(arr: ReadonlyArray<T>, getValue: (value: T) => number): { readonly min: number, readonly max: number } {
Debug.assert(arr.length !== 0);
let min = getValue(arr[0]);
+1 -1
View File
@@ -221,7 +221,7 @@ namespace ts.server {
/*@internal*/
constructor(
readonly projectName: string,
/*@internal*/ readonly projectName: string,
readonly projectKind: ProjectKind,
readonly projectService: ProjectService,
private documentRegistry: DocumentRegistry,
+43 -3
View File
@@ -322,12 +322,11 @@ namespace ts {
modifyFs: noop
});
// Verify baseline with build info
// Verify baseline with build info + dts unChanged
verifyOutFileScenario({
scenario: "when final project is not composite but uses project references",
modifyFs: fs => replaceText(fs, sources[project.third][source.config], `"composite": true,`, ""),
ignoreDtsChanged: true,
ignoreDtsUnchanged: true,
baselineOnly: true
});
@@ -437,7 +436,6 @@ namespace ts {
changeCompilerVersion(host);
builder.buildAllProjects();
host.assertDiagnosticMessages(
// TODO:: This should build all instead
getExpectedDiagnosticForProjectsInBuild(relSources[project.first][source.config], relSources[project.second][source.config], relSources[project.third][source.config]),
[Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, relSources[project.first][source.config], fakes.version, version],
[Diagnostics.Building_project_0, sources[project.first][source.config]],
@@ -844,5 +842,47 @@ ${internal} enum internalEnum { a, b, c }`);
});
});
});
it("non module projects without prepend", () => {
const fs = outFileFs.shadow();
// No prepend
replaceText(fs, sources[project.third][source.config], `{ "path": "../first", "prepend": true }`, `{ "path": "../first" }`);
replaceText(fs, sources[project.third][source.config], `{ "path": "../second", "prepend": true }`, `{ "path": "../second" }`);
// Non Modules
replaceText(fs, sources[project.first][source.config], `"composite": true,`, `"composite": true, "module": "none",`);
replaceText(fs, sources[project.second][source.config], `"composite": true,`, `"composite": true, "module": "none",`);
replaceText(fs, sources[project.third][source.config], `"composite": true,`, `"composite": true, "module": "none",`);
// Own file emit
replaceText(fs, sources[project.first][source.config], `"outFile": "./bin/first-output.js",`, "");
replaceText(fs, sources[project.second][source.config], `"outFile": "../2/second-output.js",`, "");
replaceText(fs, sources[project.third][source.config], `"outFile": "./thirdjs/output/third-output.js",`, "");
const host = new fakes.SolutionBuilderHost(fs);
const builder = createSolutionBuilder(host);
builder.buildAllProjects();
host.assertDiagnosticMessages(
getExpectedDiagnosticForProjectsInBuild(relSources[project.first][source.config], relSources[project.second][source.config], relSources[project.third][source.config]),
[Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.first][source.config], "src/first/first_PART1.js"],
[Diagnostics.Building_project_0, sources[project.first][source.config]],
[Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.second][source.config], "src/second/second_part1.js"],
[Diagnostics.Building_project_0, sources[project.second][source.config]],
[Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.third][source.config], "src/third/third_part1.js"],
[Diagnostics.Building_project_0, sources[project.third][source.config]]
);
const expectedOutputFiles = flatMap(sources, ([config, ts]) => [
removeFileExtension(config) + Extension.TsBuildInfo,
...flatMap(ts, f => [
removeFileExtension(f) + Extension.Js,
removeFileExtension(f) + Extension.Js + ".map",
removeFileExtension(f) + Extension.Dts,
removeFileExtension(f) + Extension.Dts + ".map",
])
]);
for (const output of expectedOutputFiles) {
assert(fs.existsSync(output), `Expect file ${output} to exist`);
}
});
});
}
@@ -1137,5 +1137,46 @@ export function gfoo() {
});
});
});
it("incremental updates in verbose mode", () => {
const host = createTsBuildWatchSystem(allFiles, { currentDirectory: projectsLocation });
const solutionBuilder = createSolutionBuilder(host, [`${project}/${SubProject.tests}`], { verbose: true, watch: true });
solutionBuilder.buildAllProjects();
solutionBuilder.startWatching();
checkOutputErrorsInitial(host, emptyArray, /*disableConsoleClears*/ undefined, [
`Projects in this build: \r\n * sample1/core/tsconfig.json\r\n * sample1/logic/tsconfig.json\r\n * sample1/tests/tsconfig.json\n\n`,
`Project 'sample1/core/tsconfig.json' is out of date because output file 'sample1/core/anotherModule.js' does not exist\n\n`,
`Building project '/user/username/projects/sample1/core/tsconfig.json'...\n\n`,
`Project 'sample1/logic/tsconfig.json' is out of date because output file 'sample1/logic/index.js' does not exist\n\n`,
`Building project '/user/username/projects/sample1/logic/tsconfig.json'...\n\n`,
`Project 'sample1/tests/tsconfig.json' is out of date because output file 'sample1/tests/index.js' does not exist\n\n`,
`Building project '/user/username/projects/sample1/tests/tsconfig.json'...\n\n`
]);
verifyWatches(host);
// Make non dts change
host.writeFile(logic[1].path, `${logic[1].content}
function someFn() { }`);
host.checkTimeoutQueueLengthAndRun(1); // build logic
host.checkTimeoutQueueLengthAndRun(1); // build tests
checkOutputErrorsIncremental(host, emptyArray, /*disableConsoleClears*/ undefined, /*logsBeforeWatchDiagnostics*/ undefined, [
`Project 'sample1/logic/tsconfig.json' is out of date because oldest output 'sample1/logic/index.js' is older than newest input 'sample1/core'\n\n`,
`Building project '/user/username/projects/sample1/logic/tsconfig.json'...\n\n`,
`Project 'sample1/tests/tsconfig.json' is up to date with .d.ts files from its dependencies\n\n`,
`Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'...\n\n`,
]);
// Make dts change
host.writeFile(logic[1].path, `${logic[1].content}
export function someFn() { }`);
host.checkTimeoutQueueLengthAndRun(1); // build logic
host.checkTimeoutQueueLengthAndRun(1); // build tests
checkOutputErrorsIncremental(host, emptyArray, /*disableConsoleClears*/ undefined, /*logsBeforeWatchDiagnostics*/ undefined, [
`Project 'sample1/logic/tsconfig.json' is out of date because oldest output 'sample1/logic/index.js' is older than newest input 'sample1/core'\n\n`,
`Building project '/user/username/projects/sample1/logic/tsconfig.json'...\n\n`,
`Project 'sample1/tests/tsconfig.json' is out of date because oldest output 'sample1/tests/index.js' is older than newest input 'sample1/logic/tsconfig.json'\n\n`,
`Building project '/user/username/projects/sample1/tests/tsconfig.json'...\n\n`,
]);
});
});
}
+6 -1
View File
@@ -53,6 +53,7 @@ namespace ts.tscWatch {
}
const elapsedRegex = /^Elapsed:: [0-9]+ms/;
const buildVerboseLogRegEx = /^.+ \- /;
function checkOutputErrors(
host: WatchedSystem,
logsBeforeWatchDiagnostic: string[] | undefined,
@@ -87,9 +88,13 @@ namespace ts.tscWatch {
index++;
}
function getCleanLogString(log: string) {
return log.replace(elapsedRegex, "").replace(buildVerboseLogRegEx, "");
}
function assertLog(caption: string, expected: string) {
const actual = outputs[index];
assert.equal(actual.replace(elapsedRegex, ""), expected.replace(elapsedRegex, ""), getOutputAtFailedMessage(caption, expected));
assert.equal(getCleanLogString(actual), getCleanLogString(expected), getOutputAtFailedMessage(caption, expected));
index++;
}
+2 -1
View File
@@ -7,7 +7,8 @@
"declaration": false,
"declarationMap": false,
"sourceMap": false,
"composite": false
"composite": false,
"incremental": true
},
"files": [
"tsc.ts"
@@ -1,4 +1,4 @@
tests/cases/conformance/Symbols/ES5SymbolProperty5.ts(7,1): error TS2554: Expected 0 arguments, but got 1.
tests/cases/conformance/Symbols/ES5SymbolProperty5.ts(7,26): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/conformance/Symbols/ES5SymbolProperty5.ts (1 errors) ====
@@ -9,5 +9,5 @@ tests/cases/conformance/Symbols/ES5SymbolProperty5.ts(7,1): error TS2554: Expect
}
(new C)[Symbol.iterator](0) // Should error
~~~~~~~~~~~~~~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 0 arguments, but got 1.
@@ -6,7 +6,7 @@ tests/cases/compiler/bigintWithoutLib.ts(7,30): error TS2737: BigInt literals ar
tests/cases/compiler/bigintWithoutLib.ts(8,13): error TS2304: Cannot find name 'BigInt'.
tests/cases/compiler/bigintWithoutLib.ts(8,31): error TS2737: BigInt literals are not available when targeting lower than ESNext.
tests/cases/compiler/bigintWithoutLib.ts(9,1): error TS2322: Type 'Object' is not assignable to type 'bigint'.
tests/cases/compiler/bigintWithoutLib.ts(11,13): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/bigintWithoutLib.ts(11,32): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/bigintWithoutLib.ts(15,18): error TS2304: Cannot find name 'BigInt64Array'.
tests/cases/compiler/bigintWithoutLib.ts(15,38): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'?
tests/cases/compiler/bigintWithoutLib.ts(16,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'?
@@ -73,7 +73,7 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU
!!! error TS2322: Type 'Object' is not assignable to type 'bigint'.
let stringVal: string = bigintVal.toString(); // should not error - bigintVal inferred as {}
stringVal = bigintVal.toString(2); // should error - bigintVal inferred as {}
~~~~~~~~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 0 arguments, but got 1.
stringVal = bigintVal.toLocaleString(); // should not error - bigintVal inferred as {}
@@ -1,8 +1,8 @@
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(3,18): error TS2393: Duplicate function implementation.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(5,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(5,13): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(8,18): error TS2393: Duplicate function implementation.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(10,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(12,5): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(10,13): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(12,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(16,1): error TS2554: Expected 1 arguments, but got 0.
@@ -14,7 +14,7 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(16,1): error T
!!! error TS2393: Duplicate function implementation.
foo();
foo(10); // not ok
~~~~~~~
~~
!!! error TS2554: Expected 0 arguments, but got 1.
}
else {
@@ -23,11 +23,11 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(16,1): error T
!!! error TS2393: Duplicate function implementation.
foo();
foo(10); // not ok
~~~~~~~
~~
!!! error TS2554: Expected 0 arguments, but got 1.
}
foo(10); // not ok
~~~~~~~
~~
!!! error TS2554: Expected 0 arguments, but got 1.
foo();
}
@@ -1,8 +1,8 @@
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(3,18): error TS2393: Duplicate function implementation.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(5,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(5,13): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(8,18): error TS2393: Duplicate function implementation.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(10,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(12,5): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(10,13): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(12,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(16,1): error TS2554: Expected 1 arguments, but got 0.
@@ -14,7 +14,7 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(16,1): error T
!!! error TS2393: Duplicate function implementation.
foo();
foo(10); // not ok
~~~~~~~
~~
!!! error TS2554: Expected 0 arguments, but got 1.
}
else {
@@ -23,11 +23,11 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(16,1): error T
!!! error TS2393: Duplicate function implementation.
foo();
foo(10);// not ok
~~~~~~~
~~
!!! error TS2554: Expected 0 arguments, but got 1.
}
foo(10); // not ok
~~~~~~~
~~
!!! error TS2554: Expected 0 arguments, but got 1.
foo();
}
@@ -1,7 +1,7 @@
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(4,18): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(6,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(6,13): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(9,18): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(11,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(11,13): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(14,5): error TS2554: Expected 1 arguments, but got 0.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): error TS2554: Expected 1 arguments, but got 0.
@@ -15,7 +15,7 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): e
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
foo();
foo(10); // not ok
~~~~~~~
~~
!!! error TS2554: Expected 0 arguments, but got 1.
}
else {
@@ -24,7 +24,7 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): e
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
foo();
foo(10); // not ok
~~~~~~~
~~
!!! error TS2554: Expected 0 arguments, but got 1.
}
foo(10);
@@ -1,5 +1,5 @@
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(6,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(11,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(6,13): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(11,13): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(14,5): error TS2554: Expected 1 arguments, but got 0.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(17,1): error TS2554: Expected 1 arguments, but got 0.
@@ -11,14 +11,14 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(17,1): e
function foo() { }
foo();
foo(10); // not ok
~~~~~~~
~~
!!! error TS2554: Expected 0 arguments, but got 1.
}
else {
function foo() { }
foo();
foo(10); // not ok
~~~~~~~
~~
!!! error TS2554: Expected 0 arguments, but got 1.
}
foo(10);
@@ -1,6 +1,6 @@
tests/cases/compiler/callOnInstance.ts(1,18): error TS2300: Duplicate identifier 'D'.
tests/cases/compiler/callOnInstance.ts(3,15): error TS2300: Duplicate identifier 'D'.
tests/cases/compiler/callOnInstance.ts(7,19): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/callOnInstance.ts(7,25): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures.
@@ -16,7 +16,7 @@ tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an exp
var s1: string = D(); // OK
var s2: string = (new D(1))();
~~~~~~~~
~
!!! error TS2554: Expected 0 arguments, but got 1.
declare class C { constructor(value: number); }
@@ -0,0 +1,28 @@
tests/cases/conformance/expressions/functionCalls/callOverload.ts(7,7): error TS2554: Expected 1 arguments, but got 4.
tests/cases/conformance/expressions/functionCalls/callOverload.ts(8,15): error TS2554: Expected 2 arguments, but got 4.
tests/cases/conformance/expressions/functionCalls/callOverload.ts(10,1): error TS2555: Expected at least 1 arguments, but got 0.
tests/cases/conformance/expressions/functionCalls/callOverload.ts(11,10): error TS2557: Expected at least 1 arguments, but got 0 or more.
==== tests/cases/conformance/expressions/functionCalls/callOverload.ts (4 errors) ====
declare function fn(x: any): void;
declare function takeTwo(x: any, y: any): void;
declare function withRest(a: any, ...args: Array<any>): void;
var n: number[];
fn(1) // no error
fn(1, 2, 3, 4)
~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 4.
takeTwo(1, 2, 3, 4)
~~~~
!!! error TS2554: Expected 2 arguments, but got 4.
withRest('a', ...n); // no error
withRest();
~~~~~~~~~~
!!! error TS2555: Expected at least 1 arguments, but got 0.
!!! related TS6210 tests/cases/conformance/expressions/functionCalls/callOverload.ts:3:27: An argument for 'a' was not provided.
withRest(...n);
~~~~
!!! error TS2557: Expected at least 1 arguments, but got 0 or more.
!!! related TS6210 tests/cases/conformance/expressions/functionCalls/callOverload.ts:3:27: An argument for 'a' was not provided.
+21
View File
@@ -0,0 +1,21 @@
//// [callOverload.ts]
declare function fn(x: any): void;
declare function takeTwo(x: any, y: any): void;
declare function withRest(a: any, ...args: Array<any>): void;
var n: number[];
fn(1) // no error
fn(1, 2, 3, 4)
takeTwo(1, 2, 3, 4)
withRest('a', ...n); // no error
withRest();
withRest(...n);
//// [callOverload.js]
var n;
fn(1); // no error
fn(1, 2, 3, 4);
takeTwo(1, 2, 3, 4);
withRest.apply(void 0, ['a'].concat(n)); // no error
withRest();
withRest.apply(void 0, n);
@@ -0,0 +1,39 @@
=== tests/cases/conformance/expressions/functionCalls/callOverload.ts ===
declare function fn(x: any): void;
>fn : Symbol(fn, Decl(callOverload.ts, 0, 0))
>x : Symbol(x, Decl(callOverload.ts, 0, 20))
declare function takeTwo(x: any, y: any): void;
>takeTwo : Symbol(takeTwo, Decl(callOverload.ts, 0, 34))
>x : Symbol(x, Decl(callOverload.ts, 1, 25))
>y : Symbol(y, Decl(callOverload.ts, 1, 32))
declare function withRest(a: any, ...args: Array<any>): void;
>withRest : Symbol(withRest, Decl(callOverload.ts, 1, 47))
>a : Symbol(a, Decl(callOverload.ts, 2, 26))
>args : Symbol(args, Decl(callOverload.ts, 2, 33))
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
var n: number[];
>n : Symbol(n, Decl(callOverload.ts, 3, 3))
fn(1) // no error
>fn : Symbol(fn, Decl(callOverload.ts, 0, 0))
fn(1, 2, 3, 4)
>fn : Symbol(fn, Decl(callOverload.ts, 0, 0))
takeTwo(1, 2, 3, 4)
>takeTwo : Symbol(takeTwo, Decl(callOverload.ts, 0, 34))
withRest('a', ...n); // no error
>withRest : Symbol(withRest, Decl(callOverload.ts, 1, 47))
>n : Symbol(n, Decl(callOverload.ts, 3, 3))
withRest();
>withRest : Symbol(withRest, Decl(callOverload.ts, 1, 47))
withRest(...n);
>withRest : Symbol(withRest, Decl(callOverload.ts, 1, 47))
>n : Symbol(n, Decl(callOverload.ts, 3, 3))
@@ -0,0 +1,56 @@
=== tests/cases/conformance/expressions/functionCalls/callOverload.ts ===
declare function fn(x: any): void;
>fn : (x: any) => void
>x : any
declare function takeTwo(x: any, y: any): void;
>takeTwo : (x: any, y: any) => void
>x : any
>y : any
declare function withRest(a: any, ...args: Array<any>): void;
>withRest : (a: any, ...args: any[]) => void
>a : any
>args : any[]
var n: number[];
>n : number[]
fn(1) // no error
>fn(1) : void
>fn : (x: any) => void
>1 : 1
fn(1, 2, 3, 4)
>fn(1, 2, 3, 4) : void
>fn : (x: any) => void
>1 : 1
>2 : 2
>3 : 3
>4 : 4
takeTwo(1, 2, 3, 4)
>takeTwo(1, 2, 3, 4) : void
>takeTwo : (x: any, y: any) => void
>1 : 1
>2 : 2
>3 : 3
>4 : 4
withRest('a', ...n); // no error
>withRest('a', ...n) : void
>withRest : (a: any, ...args: any[]) => void
>'a' : "a"
>...n : number
>n : number[]
withRest();
>withRest() : void
>withRest : (a: any, ...args: any[]) => void
withRest(...n);
>withRest(...n) : void
>withRest : (a: any, ...args: any[]) => void
>...n : number
>n : number[]
@@ -1,7 +1,7 @@
tests/cases/compiler/callOverloads1.ts(1,7): error TS2300: Duplicate identifier 'Foo'.
tests/cases/compiler/callOverloads1.ts(9,10): error TS2300: Duplicate identifier 'Foo'.
tests/cases/compiler/callOverloads1.ts(9,10): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/compiler/callOverloads1.ts(13,10): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/callOverloads1.ts(13,18): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/compiler/callOverloads1.ts (4 errors) ====
@@ -24,7 +24,7 @@ tests/cases/compiler/callOverloads1.ts(13,10): error TS2554: Expected 0 argument
function F1(a:any) { return a;}
var f1 = new Foo("hey");
~~~~~~~~~~~~~~
~~~~~
!!! error TS2554: Expected 0 arguments, but got 1.
@@ -4,7 +4,7 @@ tests/cases/compiler/callOverloads2.ts(11,10): error TS2389: Function implementa
tests/cases/compiler/callOverloads2.ts(11,10): error TS2393: Duplicate function implementation.
tests/cases/compiler/callOverloads2.ts(12,10): error TS2393: Duplicate function implementation.
tests/cases/compiler/callOverloads2.ts(14,10): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/compiler/callOverloads2.ts(18,10): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/callOverloads2.ts(18,18): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/compiler/callOverloads2.ts (7 errors) ====
@@ -38,7 +38,7 @@ tests/cases/compiler/callOverloads2.ts(18,10): error TS2554: Expected 0 argument
declare function Gar(s:String); // expect no error
var f1 = new Foo("hey");
~~~~~~~~~~~~~~
~~~~~
!!! error TS2554: Expected 0 arguments, but got 1.
@@ -1,5 +1,5 @@
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(22,1): error TS2556: Expected 1 arguments, but got 2 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(23,1): error TS2556: Expected 0 arguments, but got 1 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(22,13): error TS2556: Expected 1 arguments, but got 2 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(23,7): error TS2556: Expected 0 arguments, but got 1 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(26,5): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(27,5): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
@@ -9,8 +9,8 @@ tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(29,13): err
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(30,11): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(31,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(32,1): error TS2556: Expected 1-3 arguments, but got 0 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(33,1): error TS2556: Expected 1-3 arguments, but got 0 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(32,8): error TS2556: Expected 1-3 arguments, but got 0 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(33,8): error TS2556: Expected 1-3 arguments, but got 0 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(34,8): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
@@ -37,10 +37,10 @@ tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(34,8): erro
// extra arguments
normal("g", ...ns)
~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2556: Expected 1 arguments, but got 2 or more.
thunk(...ns)
~~~~~~~~~~~~
~~~~~
!!! error TS2556: Expected 0 arguments, but got 1 or more.
// bad
@@ -66,11 +66,11 @@ tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(34,8): erro
~~~~~~~~
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
prefix(...ns) // required parameters are required
~~~~~~~~~~~~~
~~~~~
!!! error TS2556: Expected 1-3 arguments, but got 0 or more.
!!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts:3:25: An argument for 's' was not provided.
prefix(...mixed)
~~~~~~~~~~~~~~~~
~~~~~~~~
!!! error TS2556: Expected 1-3 arguments, but got 0 or more.
!!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts:3:25: An argument for 's' was not provided.
prefix(...tuple)
@@ -0,0 +1,32 @@
tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts(5,14): error TS2554: Expected 2 arguments, but got 3.
tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts(6,19): error TS2554: Expected 2 arguments, but got 5.
tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts(7,19): error TS2556: Expected 2 arguments, but got 4 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts(8,19): error TS2556: Expected 2 arguments, but got 5 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts(9,16): error TS2556: Expected 2 arguments, but got 1 or more.
tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts(10,9): error TS2554: Expected 2 arguments, but got 3.
==== tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts (6 errors) ====
declare function takeTwo(a: string, b: string): void;
declare const t2: [string, string];
declare const t3: [string, string, string];
takeTwo('a', ...t2); // error on ...t2
~~~~~
!!! error TS2554: Expected 2 arguments, but got 3.
takeTwo('a', 'b', 'c', ...t2); // error on 'c' and ...t2
~~~~~~~~~~
!!! error TS2554: Expected 2 arguments, but got 5.
takeTwo('a', 'b', ...t2, 'c'); // error on ...t2 and 'c'
~~~~~~~~~~
!!! error TS2556: Expected 2 arguments, but got 4 or more.
takeTwo('a', 'b', 'c', ...t2, 'd'); // error on 'c', ...t2 and 'd'
~~~~~~~~~~~~~~~
!!! error TS2556: Expected 2 arguments, but got 5 or more.
takeTwo(...t2, 'a'); // error on 'a'
~~~
!!! error TS2556: Expected 2 arguments, but got 1 or more.
!!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts:1:37: An argument for 'b' was not provided.
takeTwo(...t3); // error on ...t3
~~~~~
!!! error TS2554: Expected 2 arguments, but got 3.
@@ -0,0 +1,19 @@
//// [callWithSpread3.ts]
declare function takeTwo(a: string, b: string): void;
declare const t2: [string, string];
declare const t3: [string, string, string];
takeTwo('a', ...t2); // error on ...t2
takeTwo('a', 'b', 'c', ...t2); // error on 'c' and ...t2
takeTwo('a', 'b', ...t2, 'c'); // error on ...t2 and 'c'
takeTwo('a', 'b', 'c', ...t2, 'd'); // error on 'c', ...t2 and 'd'
takeTwo(...t2, 'a'); // error on 'a'
takeTwo(...t3); // error on ...t3
//// [callWithSpread3.js]
takeTwo.apply(void 0, ['a'].concat(t2)); // error on ...t2
takeTwo.apply(void 0, ['a', 'b', 'c'].concat(t2)); // error on 'c' and ...t2
takeTwo.apply(void 0, ['a', 'b'].concat(t2, ['c'])); // error on ...t2 and 'c'
takeTwo.apply(void 0, ['a', 'b', 'c'].concat(t2, ['d'])); // error on 'c', ...t2 and 'd'
takeTwo.apply(void 0, t2.concat(['a'])); // error on 'a'
takeTwo.apply(void 0, t3); // error on ...t3
@@ -0,0 +1,36 @@
=== tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts ===
declare function takeTwo(a: string, b: string): void;
>takeTwo : Symbol(takeTwo, Decl(callWithSpread3.ts, 0, 0))
>a : Symbol(a, Decl(callWithSpread3.ts, 0, 25))
>b : Symbol(b, Decl(callWithSpread3.ts, 0, 35))
declare const t2: [string, string];
>t2 : Symbol(t2, Decl(callWithSpread3.ts, 1, 13))
declare const t3: [string, string, string];
>t3 : Symbol(t3, Decl(callWithSpread3.ts, 2, 13))
takeTwo('a', ...t2); // error on ...t2
>takeTwo : Symbol(takeTwo, Decl(callWithSpread3.ts, 0, 0))
>t2 : Symbol(t2, Decl(callWithSpread3.ts, 1, 13))
takeTwo('a', 'b', 'c', ...t2); // error on 'c' and ...t2
>takeTwo : Symbol(takeTwo, Decl(callWithSpread3.ts, 0, 0))
>t2 : Symbol(t2, Decl(callWithSpread3.ts, 1, 13))
takeTwo('a', 'b', ...t2, 'c'); // error on ...t2 and 'c'
>takeTwo : Symbol(takeTwo, Decl(callWithSpread3.ts, 0, 0))
>t2 : Symbol(t2, Decl(callWithSpread3.ts, 1, 13))
takeTwo('a', 'b', 'c', ...t2, 'd'); // error on 'c', ...t2 and 'd'
>takeTwo : Symbol(takeTwo, Decl(callWithSpread3.ts, 0, 0))
>t2 : Symbol(t2, Decl(callWithSpread3.ts, 1, 13))
takeTwo(...t2, 'a'); // error on 'a'
>takeTwo : Symbol(takeTwo, Decl(callWithSpread3.ts, 0, 0))
>t2 : Symbol(t2, Decl(callWithSpread3.ts, 1, 13))
takeTwo(...t3); // error on ...t3
>takeTwo : Symbol(takeTwo, Decl(callWithSpread3.ts, 0, 0))
>t3 : Symbol(t3, Decl(callWithSpread3.ts, 2, 13))
@@ -0,0 +1,60 @@
=== tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts ===
declare function takeTwo(a: string, b: string): void;
>takeTwo : (a: string, b: string) => void
>a : string
>b : string
declare const t2: [string, string];
>t2 : [string, string]
declare const t3: [string, string, string];
>t3 : [string, string, string]
takeTwo('a', ...t2); // error on ...t2
>takeTwo('a', ...t2) : void
>takeTwo : (a: string, b: string) => void
>'a' : "a"
>...t2 : string
>t2 : [string, string]
takeTwo('a', 'b', 'c', ...t2); // error on 'c' and ...t2
>takeTwo('a', 'b', 'c', ...t2) : void
>takeTwo : (a: string, b: string) => void
>'a' : "a"
>'b' : "b"
>'c' : "c"
>...t2 : string
>t2 : [string, string]
takeTwo('a', 'b', ...t2, 'c'); // error on ...t2 and 'c'
>takeTwo('a', 'b', ...t2, 'c') : void
>takeTwo : (a: string, b: string) => void
>'a' : "a"
>'b' : "b"
>...t2 : string
>t2 : [string, string]
>'c' : "c"
takeTwo('a', 'b', 'c', ...t2, 'd'); // error on 'c', ...t2 and 'd'
>takeTwo('a', 'b', 'c', ...t2, 'd') : void
>takeTwo : (a: string, b: string) => void
>'a' : "a"
>'b' : "b"
>'c' : "c"
>...t2 : string
>t2 : [string, string]
>'d' : "d"
takeTwo(...t2, 'a'); // error on 'a'
>takeTwo(...t2, 'a') : void
>takeTwo : (a: string, b: string) => void
>...t2 : string
>t2 : [string, string]
>'a' : "a"
takeTwo(...t3); // error on ...t3
>takeTwo(...t3) : void
>takeTwo : (a: string, b: string) => void
>...t3 : string
>t3 : [string, string, string]
@@ -1,5 +1,5 @@
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts(7,10): error TS2554: Expected 0 arguments, but got 1.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts(15,10): error TS2554: Expected 0 arguments, but got 1.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts(7,16): error TS2554: Expected 0 arguments, but got 1.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts(15,16): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts (2 errors) ====
@@ -10,7 +10,7 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/cl
var c = new C();
var c2 = new C(null); // error
~~~~~~~~~~~
~~~~
!!! error TS2554: Expected 0 arguments, but got 1.
class D<T extends Date> {
@@ -20,5 +20,5 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/cl
var d = new D();
var d2 = new D(null); // error
~~~~~~~~~~~
~~~~
!!! error TS2554: Expected 0 arguments, but got 1.
@@ -1,5 +1,5 @@
tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(1,7): error TS2506: 'S18' is referenced directly or indirectly in its own base expression.
tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(4,2): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(4,10): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts (2 errors) ====
@@ -9,6 +9,6 @@ tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(4,2): erro
{
}
(new S18(123)).S18 = 0;
~~~~~~~~~~~~
~~~
!!! error TS2554: Expected 0 arguments, but got 1.
@@ -0,0 +1,10 @@
//// [contextualPropertyOfGenericMappedType.ts]
// Repro for #24694
declare function f<T extends object>(data: T, handlers: { [P in keyof T]: (value: T[P], prop: P) => void; }): void;
f({ data: 0 }, { data(value, key) {} });
//// [contextualPropertyOfGenericMappedType.js]
// Repro for #24694
f({ data: 0 }, { data: function (value, key) { } });
@@ -0,0 +1,24 @@
=== tests/cases/compiler/contextualPropertyOfGenericMappedType.ts ===
// Repro for #24694
declare function f<T extends object>(data: T, handlers: { [P in keyof T]: (value: T[P], prop: P) => void; }): void;
>f : Symbol(f, Decl(contextualPropertyOfGenericMappedType.ts, 0, 0))
>T : Symbol(T, Decl(contextualPropertyOfGenericMappedType.ts, 2, 19))
>data : Symbol(data, Decl(contextualPropertyOfGenericMappedType.ts, 2, 37))
>T : Symbol(T, Decl(contextualPropertyOfGenericMappedType.ts, 2, 19))
>handlers : Symbol(handlers, Decl(contextualPropertyOfGenericMappedType.ts, 2, 45))
>P : Symbol(P, Decl(contextualPropertyOfGenericMappedType.ts, 2, 59))
>T : Symbol(T, Decl(contextualPropertyOfGenericMappedType.ts, 2, 19))
>value : Symbol(value, Decl(contextualPropertyOfGenericMappedType.ts, 2, 75))
>T : Symbol(T, Decl(contextualPropertyOfGenericMappedType.ts, 2, 19))
>P : Symbol(P, Decl(contextualPropertyOfGenericMappedType.ts, 2, 59))
>prop : Symbol(prop, Decl(contextualPropertyOfGenericMappedType.ts, 2, 87))
>P : Symbol(P, Decl(contextualPropertyOfGenericMappedType.ts, 2, 59))
f({ data: 0 }, { data(value, key) {} });
>f : Symbol(f, Decl(contextualPropertyOfGenericMappedType.ts, 0, 0))
>data : Symbol(data, Decl(contextualPropertyOfGenericMappedType.ts, 3, 3))
>data : Symbol(data, Decl(contextualPropertyOfGenericMappedType.ts, 3, 16))
>value : Symbol(value, Decl(contextualPropertyOfGenericMappedType.ts, 3, 22))
>key : Symbol(key, Decl(contextualPropertyOfGenericMappedType.ts, 3, 28))
@@ -0,0 +1,21 @@
=== tests/cases/compiler/contextualPropertyOfGenericMappedType.ts ===
// Repro for #24694
declare function f<T extends object>(data: T, handlers: { [P in keyof T]: (value: T[P], prop: P) => void; }): void;
>f : <T extends object>(data: T, handlers: { [P in keyof T]: (value: T[P], prop: P) => void; }) => void
>data : T
>handlers : { [P in keyof T]: (value: T[P], prop: P) => void; }
>value : T[P]
>prop : P
f({ data: 0 }, { data(value, key) {} });
>f({ data: 0 }, { data(value, key) {} }) : void
>f : <T extends object>(data: T, handlers: { [P in keyof T]: (value: T[P], prop: P) => void; }) => void
>{ data: 0 } : { data: number; }
>data : number
>0 : 0
>{ data(value, key) {} } : { data(value: number, key: "data"): void; }
>data : (value: number, key: "data") => void
>value : number
>key : "data"
@@ -1,17 +1,17 @@
tests/cases/compiler/couldNotSelectGenericOverload.ts(3,11): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/couldNotSelectGenericOverload.ts(7,11): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/couldNotSelectGenericOverload.ts(3,24): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/couldNotSelectGenericOverload.ts(7,25): error TS2554: Expected 1 arguments, but got 2.
==== tests/cases/compiler/couldNotSelectGenericOverload.ts (2 errors) ====
function makeArray<T>(items: T[]): T[] { return items; }
var b = [1, ""];
var b1G = makeArray(1, ""); // any, no error
~~~~~~~~~~~~~~~~
~~
!!! error TS2554: Expected 1 arguments, but got 2.
var b2G = makeArray(b); // any[]
function makeArray2(items: any[]): any[] { return items; }
var b3G = makeArray2(1, ""); // error
~~~~~~~~~~~~~~~~~
~~
!!! error TS2554: Expected 1 arguments, but got 2.
@@ -0,0 +1,108 @@
//// [declarationEmitWorkWithInlineComments.ts]
export class Foo {
constructor(
/** @internal */
public isInternal1: string,
/** @internal */ public isInternal2: string, /** @internal */
public isInternal3: string,
// @internal
public isInternal4: string,
// nothing
/** @internal */
public isInternal5: string,
/* @internal */ public isInternal6: string /* trailing */,
/* @internal */ public isInternal7: string, /** @internal */
// not work
public notInternal1: string,
// @internal
/* not work */
public notInternal2: string,
/* not work */
// @internal
/* not work */
public notInternal3: string,
) { }
}
export class Bar {
constructor(/* @internal */ public isInternal1: string) {}
}
export class Baz {
constructor(/* @internal */
public isInternal: string
) {}
}
//// [declarationEmitWorkWithInlineComments.js]
"use strict";
exports.__esModule = true;
var Foo = /** @class */ (function () {
function Foo(
/** @internal */
isInternal1,
/** @internal */ isInternal2, /** @internal */ isInternal3,
// @internal
isInternal4,
// nothing
/** @internal */
isInternal5,
/* @internal */ isInternal6 /* trailing */,
/* @internal */ isInternal7, /** @internal */
// not work
notInternal1,
// @internal
/* not work */
notInternal2,
/* not work */
// @internal
/* not work */
notInternal3) {
this.isInternal1 = isInternal1;
this.isInternal2 = isInternal2;
this.isInternal3 = isInternal3;
this.isInternal4 = isInternal4;
this.isInternal5 = isInternal5;
this.isInternal6 = isInternal6;
this.isInternal7 = isInternal7;
this.notInternal1 = notInternal1;
this.notInternal2 = notInternal2;
this.notInternal3 = notInternal3;
}
return Foo;
}());
exports.Foo = Foo;
var Bar = /** @class */ (function () {
function Bar(/* @internal */ isInternal1) {
this.isInternal1 = isInternal1;
}
return Bar;
}());
exports.Bar = Bar;
var Baz = /** @class */ (function () {
function Baz(/* @internal */ isInternal) {
this.isInternal = isInternal;
}
return Baz;
}());
exports.Baz = Baz;
//// [declarationEmitWorkWithInlineComments.d.ts]
export declare class Foo {
notInternal1: string;
notInternal2: string;
notInternal3: string;
constructor(
/** @internal */
isInternal1: string,
/** @internal */ isInternal2: string, /** @internal */ isInternal3: string, isInternal4: string,
/** @internal */
isInternal5: string, isInternal6: string, isInternal7: string, /** @internal */ notInternal1: string, notInternal2: string, notInternal3: string);
}
export declare class Bar {
constructor(/* @internal */ isInternal1: string);
}
export declare class Baz {
constructor(/* @internal */ isInternal: string);
}
@@ -0,0 +1,64 @@
=== tests/cases/conformance/declarationEmit/declarationEmitWorkWithInlineComments.ts ===
export class Foo {
>Foo : Symbol(Foo, Decl(declarationEmitWorkWithInlineComments.ts, 0, 0))
constructor(
/** @internal */
public isInternal1: string,
>isInternal1 : Symbol(Foo.isInternal1, Decl(declarationEmitWorkWithInlineComments.ts, 1, 14))
/** @internal */ public isInternal2: string, /** @internal */
>isInternal2 : Symbol(Foo.isInternal2, Decl(declarationEmitWorkWithInlineComments.ts, 3, 31))
public isInternal3: string,
>isInternal3 : Symbol(Foo.isInternal3, Decl(declarationEmitWorkWithInlineComments.ts, 4, 48))
// @internal
public isInternal4: string,
>isInternal4 : Symbol(Foo.isInternal4, Decl(declarationEmitWorkWithInlineComments.ts, 5, 31))
// nothing
/** @internal */
public isInternal5: string,
>isInternal5 : Symbol(Foo.isInternal5, Decl(declarationEmitWorkWithInlineComments.ts, 7, 31))
/* @internal */ public isInternal6: string /* trailing */,
>isInternal6 : Symbol(Foo.isInternal6, Decl(declarationEmitWorkWithInlineComments.ts, 10, 31))
/* @internal */ public isInternal7: string, /** @internal */
>isInternal7 : Symbol(Foo.isInternal7, Decl(declarationEmitWorkWithInlineComments.ts, 11, 62))
// not work
public notInternal1: string,
>notInternal1 : Symbol(Foo.notInternal1, Decl(declarationEmitWorkWithInlineComments.ts, 12, 47))
// @internal
/* not work */
public notInternal2: string,
>notInternal2 : Symbol(Foo.notInternal2, Decl(declarationEmitWorkWithInlineComments.ts, 14, 32))
/* not work */
// @internal
/* not work */
public notInternal3: string,
>notInternal3 : Symbol(Foo.notInternal3, Decl(declarationEmitWorkWithInlineComments.ts, 17, 32))
) { }
}
export class Bar {
>Bar : Symbol(Bar, Decl(declarationEmitWorkWithInlineComments.ts, 23, 1))
constructor(/* @internal */ public isInternal1: string) {}
>isInternal1 : Symbol(Bar.isInternal1, Decl(declarationEmitWorkWithInlineComments.ts, 26, 14))
}
export class Baz {
>Baz : Symbol(Baz, Decl(declarationEmitWorkWithInlineComments.ts, 27, 1))
constructor(/* @internal */
public isInternal: string
>isInternal : Symbol(Baz.isInternal, Decl(declarationEmitWorkWithInlineComments.ts, 30, 14))
) {}
}
@@ -0,0 +1,64 @@
=== tests/cases/conformance/declarationEmit/declarationEmitWorkWithInlineComments.ts ===
export class Foo {
>Foo : Foo
constructor(
/** @internal */
public isInternal1: string,
>isInternal1 : string
/** @internal */ public isInternal2: string, /** @internal */
>isInternal2 : string
public isInternal3: string,
>isInternal3 : string
// @internal
public isInternal4: string,
>isInternal4 : string
// nothing
/** @internal */
public isInternal5: string,
>isInternal5 : string
/* @internal */ public isInternal6: string /* trailing */,
>isInternal6 : string
/* @internal */ public isInternal7: string, /** @internal */
>isInternal7 : string
// not work
public notInternal1: string,
>notInternal1 : string
// @internal
/* not work */
public notInternal2: string,
>notInternal2 : string
/* not work */
// @internal
/* not work */
public notInternal3: string,
>notInternal3 : string
) { }
}
export class Bar {
>Bar : Bar
constructor(/* @internal */ public isInternal1: string) {}
>isInternal1 : string
}
export class Baz {
>Baz : Baz
constructor(/* @internal */
public isInternal: string
>isInternal : string
) {}
}
@@ -6,7 +6,9 @@ tests/cases/compiler/duplicateDefaultExport.ts(2,1): error TS2528: A module cann
export default 0;
~~~~~~~~~~~~~~~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/compiler/duplicateDefaultExport.ts:2:1: The first export default is here.
export default function() {}
~~~~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/compiler/duplicateDefaultExport.ts:1:1: Another export default is here.
@@ -6,8 +6,10 @@ tests/cases/compiler/exportDefaultAlias_excludesEverything.ts(3,16): error TS252
export default interface A {}
~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/compiler/exportDefaultAlias_excludesEverything.ts:3:16: Another export default is here.
interface B {}
export default B;
~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/compiler/exportDefaultAlias_excludesEverything.ts:1:26: The first export default is here.
@@ -1,6 +1,6 @@
tests/cases/compiler/functionCall11.ts(4,1): error TS2554: Expected 1-2 arguments, but got 0.
tests/cases/compiler/functionCall11.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
tests/cases/compiler/functionCall11.ts(6,1): error TS2554: Expected 1-2 arguments, but got 3.
tests/cases/compiler/functionCall11.ts(6,15): error TS2554: Expected 1-2 arguments, but got 3.
==== tests/cases/compiler/functionCall11.ts (3 errors) ====
@@ -15,6 +15,6 @@ tests/cases/compiler/functionCall11.ts(6,1): error TS2554: Expected 1-2 argument
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
foo('foo', 1, 'bar');
~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2554: Expected 1-2 arguments, but got 3.
@@ -1,5 +1,5 @@
tests/cases/compiler/functionCall6.ts(3,5): error TS2345: Argument of type '2' is not assignable to parameter of type 'string'.
tests/cases/compiler/functionCall6.ts(4,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/functionCall6.ts(4,12): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/functionCall6.ts(5,1): error TS2554: Expected 1 arguments, but got 0.
@@ -10,7 +10,7 @@ tests/cases/compiler/functionCall6.ts(5,1): error TS2554: Expected 1 arguments,
~
!!! error TS2345: Argument of type '2' is not assignable to parameter of type 'string'.
foo('foo', 'bar');
~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
foo();
~~~~~
@@ -1,4 +1,4 @@
tests/cases/compiler/functionCall7.ts(5,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/functionCall7.ts(5,10): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/functionCall7.ts(6,5): error TS2345: Argument of type '4' is not assignable to parameter of type 'c1'.
tests/cases/compiler/functionCall7.ts(7,1): error TS2554: Expected 1 arguments, but got 0.
@@ -9,7 +9,7 @@ tests/cases/compiler/functionCall7.ts(7,1): error TS2554: Expected 1 arguments,
var myC = new m1.c1();
foo(myC);
foo(myC, myC);
~~~~~~~~~~~~~
~~~
!!! error TS2554: Expected 1 arguments, but got 2.
foo(4);
~
@@ -1,4 +1,4 @@
tests/cases/compiler/functionCall8.ts(3,1): error TS2554: Expected 0-1 arguments, but got 2.
tests/cases/compiler/functionCall8.ts(3,12): error TS2554: Expected 0-1 arguments, but got 2.
tests/cases/compiler/functionCall8.ts(4,5): error TS2345: Argument of type '4' is not assignable to parameter of type 'string'.
@@ -6,7 +6,7 @@ tests/cases/compiler/functionCall8.ts(4,5): error TS2345: Argument of type '4' i
function foo(a?:string){}
foo('foo');
foo('foo', 'bar');
~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2554: Expected 0-1 arguments, but got 2.
foo(4);
~
@@ -1,5 +1,5 @@
tests/cases/compiler/functionCall9.ts(4,11): error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'.
tests/cases/compiler/functionCall9.ts(5,1): error TS2554: Expected 0-2 arguments, but got 3.
tests/cases/compiler/functionCall9.ts(5,15): error TS2554: Expected 0-2 arguments, but got 3.
==== tests/cases/compiler/functionCall9.ts (2 errors) ====
@@ -10,6 +10,6 @@ tests/cases/compiler/functionCall9.ts(5,1): error TS2554: Expected 0-2 arguments
~~~~~
!!! error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'.
foo('foo', 1, 'bar');
~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2554: Expected 0-2 arguments, but got 3.
foo();
@@ -1,7 +1,7 @@
tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(11,7): error TS2345: Argument of type '"s"' is not assignable to parameter of type 'never'.
tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(15,7): error TS2345: Argument of type '"s"' is not assignable to parameter of type 'never'.
tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(18,5): error TS2345: Argument of type '""' is not assignable to parameter of type 'never'.
tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(19,3): error TS2554: Expected 1 arguments, but got 4.
tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(19,9): error TS2554: Expected 1 arguments, but got 4.
==== tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts (4 errors) ====
@@ -30,6 +30,6 @@ tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(19,3): error TS255
~~
!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'never'.
a("", "", "", ""); // Error
~~~~~~~~~~~~~~~~~
~~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 4.
}
@@ -1,6 +1,6 @@
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'Function'.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(6,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(7,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(6,16): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(7,8): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(23,14): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'.
Type 'Function' provides no match for the signature '(x: string): string'.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(24,15): error TS2345: Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'.
@@ -33,10 +33,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'Function'.
foo(() => { }, 1);
~~~~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 1 arguments, but got 2.
foo(1, () => { });
~~~~~~~~~~~~~~~~~
~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
function foo2<T extends (x: string) => string>(x: T): T { return x; }
@@ -1,10 +1,10 @@
tests/cases/compiler/functionParameterArityMismatch.ts(3,1): error TS2554: Expected 1-3 arguments, but got 0.
tests/cases/compiler/functionParameterArityMismatch.ts(4,1): error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 3 arguments.
tests/cases/compiler/functionParameterArityMismatch.ts(5,1): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/compiler/functionParameterArityMismatch.ts(5,13): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/compiler/functionParameterArityMismatch.ts(11,1): error TS2575: No overload expects 1 arguments, but overloads do exist that expect either 0 or 2 arguments.
tests/cases/compiler/functionParameterArityMismatch.ts(12,1): error TS2575: No overload expects 3 arguments, but overloads do exist that expect either 2 or 4 arguments.
tests/cases/compiler/functionParameterArityMismatch.ts(13,1): error TS2575: No overload expects 5 arguments, but overloads do exist that expect either 4 or 6 arguments.
tests/cases/compiler/functionParameterArityMismatch.ts(14,1): error TS2554: Expected 0-6 arguments, but got 7.
tests/cases/compiler/functionParameterArityMismatch.ts(14,22): error TS2554: Expected 0-6 arguments, but got 7.
==== tests/cases/compiler/functionParameterArityMismatch.ts (7 errors) ====
@@ -18,7 +18,7 @@ tests/cases/compiler/functionParameterArityMismatch.ts(14,1): error TS2554: Expe
~~~~~~~~
!!! error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 3 arguments.
f1(1, 2, 3, 4);
~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 1-3 arguments, but got 4.
declare function f2();
@@ -35,6 +35,6 @@ tests/cases/compiler/functionParameterArityMismatch.ts(14,1): error TS2554: Expe
~~~~~~~~~~~~~~~~~
!!! error TS2575: No overload expects 5 arguments, but overloads do exist that expect either 4 or 6 arguments.
f2(1, 2, 3, 4, 5, 6, 7);
~~~~~~~~~~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 0-6 arguments, but got 7.
@@ -1,5 +1,5 @@
tests/cases/conformance/types/rest/genericRestArity.ts(7,1): error TS2554: Expected 3 arguments, but got 1.
tests/cases/conformance/types/rest/genericRestArity.ts(8,1): error TS2554: Expected 3 arguments, but got 8.
tests/cases/conformance/types/rest/genericRestArity.ts(8,45): error TS2554: Expected 3 arguments, but got 8.
==== tests/cases/conformance/types/rest/genericRestArity.ts (2 errors) ====
@@ -14,6 +14,6 @@ tests/cases/conformance/types/rest/genericRestArity.ts(8,1): error TS2554: Expec
!!! error TS2554: Expected 3 arguments, but got 1.
!!! related TS6210 tests/cases/conformance/types/rest/genericRestArity.ts:5:5: An argument for 'args' was not provided.
call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~
!!! error TS2554: Expected 3 arguments, but got 8.
@@ -1,5 +1,5 @@
tests/cases/conformance/types/rest/genericRestArityStrict.ts(7,1): error TS2554: Expected 3 arguments, but got 1.
tests/cases/conformance/types/rest/genericRestArityStrict.ts(8,1): error TS2554: Expected 3 arguments, but got 8.
tests/cases/conformance/types/rest/genericRestArityStrict.ts(8,45): error TS2554: Expected 3 arguments, but got 8.
==== tests/cases/conformance/types/rest/genericRestArityStrict.ts (2 errors) ====
@@ -14,6 +14,6 @@ tests/cases/conformance/types/rest/genericRestArityStrict.ts(8,1): error TS2554:
!!! error TS2554: Expected 3 arguments, but got 1.
!!! related TS6210 tests/cases/conformance/types/rest/genericRestArityStrict.ts:5:5: An argument for 'args' was not provided.
call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~
!!! error TS2554: Expected 3 arguments, but got 8.
@@ -1,5 +1,5 @@
tests/cases/conformance/types/rest/genericRestParameters1.ts(22,1): error TS2556: Expected 3 arguments, but got 1 or more.
tests/cases/conformance/types/rest/genericRestParameters1.ts(31,1): error TS2556: Expected 3 arguments, but got 1 or more.
tests/cases/conformance/types/rest/genericRestParameters1.ts(22,11): error TS2556: Expected 3 arguments, but got 1 or more.
tests/cases/conformance/types/rest/genericRestParameters1.ts(31,11): error TS2556: Expected 3 arguments, but got 1 or more.
tests/cases/conformance/types/rest/genericRestParameters1.ts(135,23): error TS2344: Type 'Function' does not satisfy the constraint '(...args: any) => any'.
Type 'Function' provides no match for the signature '(...args: any): any'.
tests/cases/conformance/types/rest/genericRestParameters1.ts(164,1): error TS2322: Type '(a: never) => void' is not assignable to type '(...args: any[]) => void'.
@@ -30,7 +30,7 @@ tests/cases/conformance/types/rest/genericRestParameters1.ts(164,1): error TS232
f1(42, "hello", true, ...t0);
f1(ns[0], ns[1], true);
f1(...ns, true); // Error, tuple spread only expanded when last
~~~~~~~~~~~~~~~
~~~~
!!! error TS2556: Expected 3 arguments, but got 1 or more.
f2(42, "hello", true);
@@ -41,7 +41,7 @@ tests/cases/conformance/types/rest/genericRestParameters1.ts(164,1): error TS232
f2(42, "hello", true, ...t0);
f2(ns[0], ns[1], true);
f2(...ns, true); // Error, tuple spread only expanded when last
~~~~~~~~~~~~~~~
~~~~
!!! error TS2556: Expected 3 arguments, but got 1 or more.
!!! related TS6210 tests/cases/conformance/types/rest/genericRestParameters1.ts:2:30: An argument for 'x1' was not provided.
@@ -1,5 +1,5 @@
tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts(8,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts(9,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts(8,10): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts(9,10): error TS2554: Expected 1 arguments, but got 2.
==== tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts (2 errors) ====
@@ -11,10 +11,10 @@ tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts(9,1): er
f(g<A, B>(7));
f(g < A, B > 7); // Should error
~~~~~~~~~~~~~~~
~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
f(g < A, B > +(7)); // Should error
~~~~~~~~~~~~~~~~~~
~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
@@ -1,9 +1,9 @@
tests/cases/compiler/grammarAmbiguities1.ts(8,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/grammarAmbiguities1.ts(8,3): error TS2365: Operator '<' cannot be applied to types '<T, U>(x: any) => any' and 'typeof A'.
tests/cases/compiler/grammarAmbiguities1.ts(8,10): error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'.
tests/cases/compiler/grammarAmbiguities1.ts(9,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/grammarAmbiguities1.ts(8,10): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/grammarAmbiguities1.ts(9,3): error TS2365: Operator '<' cannot be applied to types '<T, U>(x: any) => any' and 'typeof A'.
tests/cases/compiler/grammarAmbiguities1.ts(9,10): error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'.
tests/cases/compiler/grammarAmbiguities1.ts(9,10): error TS2554: Expected 1 arguments, but got 2.
==== tests/cases/compiler/grammarAmbiguities1.ts (6 errors) ====
@@ -15,17 +15,17 @@ tests/cases/compiler/grammarAmbiguities1.ts(9,10): error TS2365: Operator '>' ca
f(g<A, B>(7));
f(g < A, B > 7);
~~~~~~~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
~~~~~
!!! error TS2365: Operator '<' cannot be applied to types '<T, U>(x: any) => any' and 'typeof A'.
~~~~~
!!! error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'.
f(g < A, B > +(7));
~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
f(g < A, B > +(7));
~~~~~
!!! error TS2365: Operator '<' cannot be applied to types '<T, U>(x: any) => any' and 'typeof A'.
~~~~~~~~
!!! error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'.
~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
@@ -0,0 +1,10 @@
//// [intersectionOfMixinConstructorTypeAndNonConstructorType.ts]
// Repro for #17388
declare let x: {foo: undefined} & {new(...args: any[]): any};
new x();
//// [intersectionOfMixinConstructorTypeAndNonConstructorType.js]
// Repro for #17388
new x();
@@ -0,0 +1,11 @@
=== tests/cases/compiler/intersectionOfMixinConstructorTypeAndNonConstructorType.ts ===
// Repro for #17388
declare let x: {foo: undefined} & {new(...args: any[]): any};
>x : Symbol(x, Decl(intersectionOfMixinConstructorTypeAndNonConstructorType.ts, 2, 11))
>foo : Symbol(foo, Decl(intersectionOfMixinConstructorTypeAndNonConstructorType.ts, 2, 16))
>args : Symbol(args, Decl(intersectionOfMixinConstructorTypeAndNonConstructorType.ts, 2, 39))
new x();
>x : Symbol(x, Decl(intersectionOfMixinConstructorTypeAndNonConstructorType.ts, 2, 11))
@@ -0,0 +1,12 @@
=== tests/cases/compiler/intersectionOfMixinConstructorTypeAndNonConstructorType.ts ===
// Repro for #17388
declare let x: {foo: undefined} & {new(...args: any[]): any};
>x : { foo: undefined; } & (new (...args: any[]) => any)
>foo : undefined
>args : any[]
new x();
>new x() : any
>x : { foo: undefined; } & (new (...args: any[]) => any)
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts(15,1): error TS2556: Expected 1 arguments, but got 0 or more.
tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts(15,5): error TS2556: Expected 1 arguments, but got 0 or more.
==== tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts (1 errors) ====
@@ -17,6 +17,6 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts(15,1): error TS2556:
}
foo(...new SymbolIterator);
~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2556: Expected 1 arguments, but got 0 or more.
!!! related TS6210 tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts:1:14: An argument for 's' was not provided.
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts(15,1): error TS2556: Expected 1 arguments, but got 0 or more.
tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts(15,5): error TS2556: Expected 1 arguments, but got 0 or more.
==== tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts (1 errors) ====
@@ -17,6 +17,6 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts(15,1): error TS2556
}
foo(...new SymbolIterator);
~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2556: Expected 1 arguments, but got 0 or more.
!!! related TS6210 tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts:1:17: An argument for 's' was not provided.
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts(15,1): error TS2556: Expected 1 arguments, but got 0 or more.
tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts(15,5): error TS2556: Expected 1 arguments, but got 0 or more.
==== tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts (1 errors) ====
@@ -17,6 +17,6 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts(15,1): error TS2556:
}
foo(...new SymbolIterator);
~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2556: Expected 1 arguments, but got 0 or more.
!!! related TS6210 tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts:1:14: An argument for 's' was not provided.
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts(15,1): error TS2557: Expected at least 1 arguments, but got 0 or more.
tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts(15,5): error TS2557: Expected at least 1 arguments, but got 0 or more.
==== tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts (1 errors) ====
@@ -17,6 +17,6 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts(15,1): error TS2557:
}
foo(...new SymbolIterator);
~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2557: Expected at least 1 arguments, but got 0 or more.
!!! related TS6210 tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts:1:14: An argument for 's1' was not provided.
@@ -9,12 +9,14 @@ tests/cases/compiler/a.js(3,20): error TS2652: Merged declaration 'a' cannot inc
export default class a {
~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/compiler/a.js:3:15: Another export default is here.
~
!!! error TS2652: Merged declaration 'a' cannot include a default export declaration. Consider adding a separate 'export default a' declaration instead.
}
export default var a = 10;
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/compiler/a.js:1:22: The first export default is here.
~~~
!!! error TS1109: Expression expected.
~
@@ -3,7 +3,7 @@ tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(4,15): error TS8020
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(4,32): error TS8020: JSDoc types can only be used inside documentation comments.
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(7,20): error TS8020: JSDoc types can only be used inside documentation comments.
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(10,18): error TS8020: JSDoc types can only be used inside documentation comments.
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(11,12): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(11,18): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(13,14): error TS8020: JSDoc types can only be used inside documentation comments.
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(14,11): error TS8020: JSDoc types can only be used inside documentation comments.
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(15,8): error TS8020: JSDoc types can only be used inside documentation comments.
@@ -38,7 +38,7 @@ tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(22,17): error TS802
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS8020: JSDoc types can only be used inside documentation comments.
return f(12, 'hullo');
~~~~~~~~~~~~~~
~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
}
var whatevs: * = 1001;
@@ -0,0 +1,36 @@
//// [mappedTypeContextualTypesApplied.ts]
type TakeString = (s: string) => any;
// Various functions accepting an object whose properties are TakeString functions.
// Note these all use mapped types.
declare function mapped1<T extends {[P in string]: TakeString}>(obj: T): void;
declare function mapped2<T extends {[P in keyof T]: TakeString}>(obj: T): void;
declare function mapped3<T extends {[P in keyof any]: TakeString}>(obj: T): void;
declare function mapped4<T>(obj: T & {[P in keyof T]: TakeString}): void;
declare function mapped5<T, K extends keyof T>(obj: T & {[P in K]: TakeString}): void;
declare function mapped6<K extends string>(obj: {[P in K]: TakeString}): void;
declare function mapped7<K extends keyof any>(obj: {[P in K]: TakeString}): void;
declare function mapped8<K extends 'foo'>(obj: {[P in K]: TakeString}): void;
declare function mapped9<K extends 'foo'|'bar'>(obj: {[P in K]: TakeString}): void;
mapped1({foo: s => 42});
mapped2({foo: s => 42});
mapped3({foo: s => 42});
mapped4({foo: s => 42});
mapped5({foo: s => 42});
mapped6({foo: s => 42});
mapped7({foo: s => 42});
mapped8({foo: s => 42});
mapped9({foo: s => 42});
//// [mappedTypeContextualTypesApplied.js]
"use strict";
mapped1({ foo: function (s) { return 42; } });
mapped2({ foo: function (s) { return 42; } });
mapped3({ foo: function (s) { return 42; } });
mapped4({ foo: function (s) { return 42; } });
mapped5({ foo: function (s) { return 42; } });
mapped6({ foo: function (s) { return 42; } });
mapped7({ foo: function (s) { return 42; } });
mapped8({ foo: function (s) { return 42; } });
mapped9({ foo: function (s) { return 42; } });
@@ -0,0 +1,129 @@
=== tests/cases/compiler/mappedTypeContextualTypesApplied.ts ===
type TakeString = (s: string) => any;
>TakeString : Symbol(TakeString, Decl(mappedTypeContextualTypesApplied.ts, 0, 0))
>s : Symbol(s, Decl(mappedTypeContextualTypesApplied.ts, 0, 19))
// Various functions accepting an object whose properties are TakeString functions.
// Note these all use mapped types.
declare function mapped1<T extends {[P in string]: TakeString}>(obj: T): void;
>mapped1 : Symbol(mapped1, Decl(mappedTypeContextualTypesApplied.ts, 0, 37))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 4, 25))
>P : Symbol(P, Decl(mappedTypeContextualTypesApplied.ts, 4, 37))
>TakeString : Symbol(TakeString, Decl(mappedTypeContextualTypesApplied.ts, 0, 0))
>obj : Symbol(obj, Decl(mappedTypeContextualTypesApplied.ts, 4, 64))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 4, 25))
declare function mapped2<T extends {[P in keyof T]: TakeString}>(obj: T): void;
>mapped2 : Symbol(mapped2, Decl(mappedTypeContextualTypesApplied.ts, 4, 78))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 5, 25))
>P : Symbol(P, Decl(mappedTypeContextualTypesApplied.ts, 5, 37))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 5, 25))
>TakeString : Symbol(TakeString, Decl(mappedTypeContextualTypesApplied.ts, 0, 0))
>obj : Symbol(obj, Decl(mappedTypeContextualTypesApplied.ts, 5, 65))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 5, 25))
declare function mapped3<T extends {[P in keyof any]: TakeString}>(obj: T): void;
>mapped3 : Symbol(mapped3, Decl(mappedTypeContextualTypesApplied.ts, 5, 79))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 6, 25))
>P : Symbol(P, Decl(mappedTypeContextualTypesApplied.ts, 6, 37))
>TakeString : Symbol(TakeString, Decl(mappedTypeContextualTypesApplied.ts, 0, 0))
>obj : Symbol(obj, Decl(mappedTypeContextualTypesApplied.ts, 6, 67))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 6, 25))
declare function mapped4<T>(obj: T & {[P in keyof T]: TakeString}): void;
>mapped4 : Symbol(mapped4, Decl(mappedTypeContextualTypesApplied.ts, 6, 81))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 7, 25))
>obj : Symbol(obj, Decl(mappedTypeContextualTypesApplied.ts, 7, 28))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 7, 25))
>P : Symbol(P, Decl(mappedTypeContextualTypesApplied.ts, 7, 39))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 7, 25))
>TakeString : Symbol(TakeString, Decl(mappedTypeContextualTypesApplied.ts, 0, 0))
declare function mapped5<T, K extends keyof T>(obj: T & {[P in K]: TakeString}): void;
>mapped5 : Symbol(mapped5, Decl(mappedTypeContextualTypesApplied.ts, 7, 73))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 8, 25))
>K : Symbol(K, Decl(mappedTypeContextualTypesApplied.ts, 8, 27))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 8, 25))
>obj : Symbol(obj, Decl(mappedTypeContextualTypesApplied.ts, 8, 47))
>T : Symbol(T, Decl(mappedTypeContextualTypesApplied.ts, 8, 25))
>P : Symbol(P, Decl(mappedTypeContextualTypesApplied.ts, 8, 58))
>K : Symbol(K, Decl(mappedTypeContextualTypesApplied.ts, 8, 27))
>TakeString : Symbol(TakeString, Decl(mappedTypeContextualTypesApplied.ts, 0, 0))
declare function mapped6<K extends string>(obj: {[P in K]: TakeString}): void;
>mapped6 : Symbol(mapped6, Decl(mappedTypeContextualTypesApplied.ts, 8, 86))
>K : Symbol(K, Decl(mappedTypeContextualTypesApplied.ts, 9, 25))
>obj : Symbol(obj, Decl(mappedTypeContextualTypesApplied.ts, 9, 43))
>P : Symbol(P, Decl(mappedTypeContextualTypesApplied.ts, 9, 50))
>K : Symbol(K, Decl(mappedTypeContextualTypesApplied.ts, 9, 25))
>TakeString : Symbol(TakeString, Decl(mappedTypeContextualTypesApplied.ts, 0, 0))
declare function mapped7<K extends keyof any>(obj: {[P in K]: TakeString}): void;
>mapped7 : Symbol(mapped7, Decl(mappedTypeContextualTypesApplied.ts, 9, 78))
>K : Symbol(K, Decl(mappedTypeContextualTypesApplied.ts, 10, 25))
>obj : Symbol(obj, Decl(mappedTypeContextualTypesApplied.ts, 10, 46))
>P : Symbol(P, Decl(mappedTypeContextualTypesApplied.ts, 10, 53))
>K : Symbol(K, Decl(mappedTypeContextualTypesApplied.ts, 10, 25))
>TakeString : Symbol(TakeString, Decl(mappedTypeContextualTypesApplied.ts, 0, 0))
declare function mapped8<K extends 'foo'>(obj: {[P in K]: TakeString}): void;
>mapped8 : Symbol(mapped8, Decl(mappedTypeContextualTypesApplied.ts, 10, 81))
>K : Symbol(K, Decl(mappedTypeContextualTypesApplied.ts, 11, 25))
>obj : Symbol(obj, Decl(mappedTypeContextualTypesApplied.ts, 11, 42))
>P : Symbol(P, Decl(mappedTypeContextualTypesApplied.ts, 11, 49))
>K : Symbol(K, Decl(mappedTypeContextualTypesApplied.ts, 11, 25))
>TakeString : Symbol(TakeString, Decl(mappedTypeContextualTypesApplied.ts, 0, 0))
declare function mapped9<K extends 'foo'|'bar'>(obj: {[P in K]: TakeString}): void;
>mapped9 : Symbol(mapped9, Decl(mappedTypeContextualTypesApplied.ts, 11, 77))
>K : Symbol(K, Decl(mappedTypeContextualTypesApplied.ts, 12, 25))
>obj : Symbol(obj, Decl(mappedTypeContextualTypesApplied.ts, 12, 48))
>P : Symbol(P, Decl(mappedTypeContextualTypesApplied.ts, 12, 55))
>K : Symbol(K, Decl(mappedTypeContextualTypesApplied.ts, 12, 25))
>TakeString : Symbol(TakeString, Decl(mappedTypeContextualTypesApplied.ts, 0, 0))
mapped1({foo: s => 42});
>mapped1 : Symbol(mapped1, Decl(mappedTypeContextualTypesApplied.ts, 0, 37))
>foo : Symbol(foo, Decl(mappedTypeContextualTypesApplied.ts, 14, 9))
>s : Symbol(s, Decl(mappedTypeContextualTypesApplied.ts, 14, 13))
mapped2({foo: s => 42});
>mapped2 : Symbol(mapped2, Decl(mappedTypeContextualTypesApplied.ts, 4, 78))
>foo : Symbol(foo, Decl(mappedTypeContextualTypesApplied.ts, 15, 9))
>s : Symbol(s, Decl(mappedTypeContextualTypesApplied.ts, 15, 13))
mapped3({foo: s => 42});
>mapped3 : Symbol(mapped3, Decl(mappedTypeContextualTypesApplied.ts, 5, 79))
>foo : Symbol(foo, Decl(mappedTypeContextualTypesApplied.ts, 16, 9))
>s : Symbol(s, Decl(mappedTypeContextualTypesApplied.ts, 16, 13))
mapped4({foo: s => 42});
>mapped4 : Symbol(mapped4, Decl(mappedTypeContextualTypesApplied.ts, 6, 81))
>foo : Symbol(foo, Decl(mappedTypeContextualTypesApplied.ts, 17, 9))
>s : Symbol(s, Decl(mappedTypeContextualTypesApplied.ts, 17, 13))
mapped5({foo: s => 42});
>mapped5 : Symbol(mapped5, Decl(mappedTypeContextualTypesApplied.ts, 7, 73))
>foo : Symbol(foo, Decl(mappedTypeContextualTypesApplied.ts, 18, 9))
>s : Symbol(s, Decl(mappedTypeContextualTypesApplied.ts, 18, 13))
mapped6({foo: s => 42});
>mapped6 : Symbol(mapped6, Decl(mappedTypeContextualTypesApplied.ts, 8, 86))
>foo : Symbol(foo, Decl(mappedTypeContextualTypesApplied.ts, 19, 9))
>s : Symbol(s, Decl(mappedTypeContextualTypesApplied.ts, 19, 13))
mapped7({foo: s => 42});
>mapped7 : Symbol(mapped7, Decl(mappedTypeContextualTypesApplied.ts, 9, 78))
>foo : Symbol(foo, Decl(mappedTypeContextualTypesApplied.ts, 20, 9))
>s : Symbol(s, Decl(mappedTypeContextualTypesApplied.ts, 20, 13))
mapped8({foo: s => 42});
>mapped8 : Symbol(mapped8, Decl(mappedTypeContextualTypesApplied.ts, 10, 81))
>foo : Symbol(foo, Decl(mappedTypeContextualTypesApplied.ts, 21, 9))
>s : Symbol(s, Decl(mappedTypeContextualTypesApplied.ts, 21, 13))
mapped9({foo: s => 42});
>mapped9 : Symbol(mapped9, Decl(mappedTypeContextualTypesApplied.ts, 11, 77))
>foo : Symbol(foo, Decl(mappedTypeContextualTypesApplied.ts, 22, 9))
>s : Symbol(s, Decl(mappedTypeContextualTypesApplied.ts, 22, 13))
@@ -0,0 +1,124 @@
=== tests/cases/compiler/mappedTypeContextualTypesApplied.ts ===
type TakeString = (s: string) => any;
>TakeString : TakeString
>s : string
// Various functions accepting an object whose properties are TakeString functions.
// Note these all use mapped types.
declare function mapped1<T extends {[P in string]: TakeString}>(obj: T): void;
>mapped1 : <T extends { [x: string]: TakeString; }>(obj: T) => void
>obj : T
declare function mapped2<T extends {[P in keyof T]: TakeString}>(obj: T): void;
>mapped2 : <T extends { [P in keyof T]: TakeString; }>(obj: T) => void
>obj : T
declare function mapped3<T extends {[P in keyof any]: TakeString}>(obj: T): void;
>mapped3 : <T extends { [x: string]: TakeString; }>(obj: T) => void
>obj : T
declare function mapped4<T>(obj: T & {[P in keyof T]: TakeString}): void;
>mapped4 : <T>(obj: T & { [P in keyof T]: TakeString; }) => void
>obj : T & { [P in keyof T]: TakeString; }
declare function mapped5<T, K extends keyof T>(obj: T & {[P in K]: TakeString}): void;
>mapped5 : <T, K extends keyof T>(obj: T & { [P in K]: TakeString; }) => void
>obj : T & { [P in K]: TakeString; }
declare function mapped6<K extends string>(obj: {[P in K]: TakeString}): void;
>mapped6 : <K extends string>(obj: { [P in K]: TakeString; }) => void
>obj : { [P in K]: TakeString; }
declare function mapped7<K extends keyof any>(obj: {[P in K]: TakeString}): void;
>mapped7 : <K extends string | number | symbol>(obj: { [P in K]: TakeString; }) => void
>obj : { [P in K]: TakeString; }
declare function mapped8<K extends 'foo'>(obj: {[P in K]: TakeString}): void;
>mapped8 : <K extends "foo">(obj: { [P in K]: TakeString; }) => void
>obj : { [P in K]: TakeString; }
declare function mapped9<K extends 'foo'|'bar'>(obj: {[P in K]: TakeString}): void;
>mapped9 : <K extends "foo" | "bar">(obj: { [P in K]: TakeString; }) => void
>obj : { [P in K]: TakeString; }
mapped1({foo: s => 42});
>mapped1({foo: s => 42}) : void
>mapped1 : <T extends { [x: string]: TakeString; }>(obj: T) => void
>{foo: s => 42} : { foo: (s: string) => number; }
>foo : (s: string) => number
>s => 42 : (s: string) => number
>s : string
>42 : 42
mapped2({foo: s => 42});
>mapped2({foo: s => 42}) : void
>mapped2 : <T extends { [P in keyof T]: TakeString; }>(obj: T) => void
>{foo: s => 42} : { foo: (s: string) => number; }
>foo : (s: string) => number
>s => 42 : (s: string) => number
>s : string
>42 : 42
mapped3({foo: s => 42});
>mapped3({foo: s => 42}) : void
>mapped3 : <T extends { [x: string]: TakeString; }>(obj: T) => void
>{foo: s => 42} : { foo: (s: string) => number; }
>foo : (s: string) => number
>s => 42 : (s: string) => number
>s : string
>42 : 42
mapped4({foo: s => 42});
>mapped4({foo: s => 42}) : void
>mapped4 : <T>(obj: T & { [P in keyof T]: TakeString; }) => void
>{foo: s => 42} : { foo: (s: string) => number; }
>foo : (s: string) => number
>s => 42 : (s: string) => number
>s : string
>42 : 42
mapped5({foo: s => 42});
>mapped5({foo: s => 42}) : void
>mapped5 : <T, K extends keyof T>(obj: T & { [P in K]: TakeString; }) => void
>{foo: s => 42} : { foo: (s: string) => number; }
>foo : (s: string) => number
>s => 42 : (s: string) => number
>s : string
>42 : 42
mapped6({foo: s => 42});
>mapped6({foo: s => 42}) : void
>mapped6 : <K extends string>(obj: { [P in K]: TakeString; }) => void
>{foo: s => 42} : { foo: (s: string) => number; }
>foo : (s: string) => number
>s => 42 : (s: string) => number
>s : string
>42 : 42
mapped7({foo: s => 42});
>mapped7({foo: s => 42}) : void
>mapped7 : <K extends string | number | symbol>(obj: { [P in K]: TakeString; }) => void
>{foo: s => 42} : { foo: (s: string) => number; }
>foo : (s: string) => number
>s => 42 : (s: string) => number
>s : string
>42 : 42
mapped8({foo: s => 42});
>mapped8({foo: s => 42}) : void
>mapped8 : <K extends "foo">(obj: { [P in K]: TakeString; }) => void
>{foo: s => 42} : { foo: (s: string) => number; }
>foo : (s: string) => number
>s => 42 : (s: string) => number
>s : string
>42 : 42
mapped9({foo: s => 42});
>mapped9({foo: s => 42}) : void
>mapped9 : <K extends "foo" | "bar">(obj: { [P in K]: TakeString; }) => void
>{foo: s => 42} : { foo: (s: string) => number; }
>foo : (s: string) => number
>s => 42 : (s: string) => number
>s : string
>42 : 42
@@ -1,18 +1,24 @@
tests/cases/conformance/es6/modules/m1.ts(1,22): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/es6/modules/m1.ts(5,25): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/es6/modules/m1.ts(5,25): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/es6/modules/m1.ts(10,16): error TS2528: A module cannot have multiple default exports.
==== tests/cases/conformance/es6/modules/m1.ts (3 errors) ====
==== tests/cases/conformance/es6/modules/m1.ts (4 errors) ====
export default class foo {
~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/es6/modules/m1.ts:5:25: The first export default is here.
}
export default function bar() {
~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/es6/modules/m1.ts:1:22: Another export default is here.
~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/es6/modules/m1.ts:10:16: Another export default is here.
}
@@ -20,6 +26,7 @@ tests/cases/conformance/es6/modules/m1.ts(10,16): error TS2528: A module cannot
export default x;
~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/es6/modules/m1.ts:5:25: The first export default is here.
==== tests/cases/conformance/es6/modules/m2.ts (0 errors) ====
import Entity from "./m1"
@@ -6,9 +6,11 @@ tests/cases/conformance/es6/modules/multipleDefaultExports03.ts(4,22): error TS2
export default class C {
~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/es6/modules/multipleDefaultExports03.ts:4:22: Another export default is here.
}
export default class C {
~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/es6/modules/multipleDefaultExports03.ts:1:22: The first export default is here.
}
@@ -0,0 +1,25 @@
tests/cases/conformance/es6/modules/multipleDefaultExports05.ts(1,22): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/es6/modules/multipleDefaultExports05.ts(1,22): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/es6/modules/multipleDefaultExports05.ts(3,22): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/es6/modules/multipleDefaultExports05.ts(5,22): error TS2528: A module cannot have multiple default exports.
==== tests/cases/conformance/es6/modules/multipleDefaultExports05.ts (4 errors) ====
export default class AA1 {}
~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/es6/modules/multipleDefaultExports05.ts:3:22: Another export default is here.
~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/es6/modules/multipleDefaultExports05.ts:5:22: Another export default is here.
export default class BB1 {}
~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/es6/modules/multipleDefaultExports05.ts:1:22: The first export default is here.
export default class CC1 {}
~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/es6/modules/multipleDefaultExports05.ts:1:22: The first export default is here.
@@ -0,0 +1,29 @@
//// [multipleDefaultExports05.ts]
export default class AA1 {}
export default class BB1 {}
export default class CC1 {}
//// [multipleDefaultExports05.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var AA1 = /** @class */ (function () {
function AA1() {
}
return AA1;
}());
exports.default = AA1;
var BB1 = /** @class */ (function () {
function BB1() {
}
return BB1;
}());
exports.default = BB1;
var CC1 = /** @class */ (function () {
function CC1() {
}
return CC1;
}());
exports.default = CC1;
@@ -0,0 +1,10 @@
=== tests/cases/conformance/es6/modules/multipleDefaultExports05.ts ===
export default class AA1 {}
>AA1 : Symbol(AA1, Decl(multipleDefaultExports05.ts, 0, 0))
export default class BB1 {}
>BB1 : Symbol(BB1, Decl(multipleDefaultExports05.ts, 0, 27))
export default class CC1 {}
>CC1 : Symbol(CC1, Decl(multipleDefaultExports05.ts, 2, 27))
@@ -0,0 +1,10 @@
=== tests/cases/conformance/es6/modules/multipleDefaultExports05.ts ===
export default class AA1 {}
>AA1 : AA1
export default class BB1 {}
>BB1 : import("tests/cases/conformance/es6/modules/multipleDefaultExports05").default
export default class CC1 {}
>CC1 : import("tests/cases/conformance/es6/modules/multipleDefaultExports05").default
@@ -6,6 +6,7 @@ tests/cases/conformance/externalModules/multipleExportDefault1.ts(5,1): error TS
export default function Foo (){
~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/externalModules/multipleExportDefault1.ts:5:1: Another export default is here.
}
@@ -16,4 +17,5 @@ tests/cases/conformance/externalModules/multipleExportDefault1.ts(5,1): error TS
};
~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/externalModules/multipleExportDefault1.ts:1:25: The first export default is here.
@@ -10,9 +10,11 @@ tests/cases/conformance/externalModules/multipleExportDefault2.ts(5,25): error T
};
~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/externalModules/multipleExportDefault2.ts:5:25: The first export default is here.
export default function Foo() { }
~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/externalModules/multipleExportDefault2.ts:1:1: Another export default is here.
@@ -10,9 +10,11 @@ tests/cases/conformance/externalModules/multipleExportDefault3.ts(5,22): error T
};
~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/externalModules/multipleExportDefault3.ts:5:22: Another export default is here.
export default class C { }
~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/externalModules/multipleExportDefault3.ts:1:1: The first export default is here.
@@ -6,6 +6,7 @@ tests/cases/conformance/externalModules/multipleExportDefault4.ts(3,1): error TS
export default class C { }
~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/externalModules/multipleExportDefault4.ts:3:1: Another export default is here.
export default {
~~~~~~~~~~~~~~~~
@@ -13,4 +14,5 @@ tests/cases/conformance/externalModules/multipleExportDefault4.ts(3,1): error TS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
};
~~
!!! error TS2528: A module cannot have multiple default exports.
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/externalModules/multipleExportDefault4.ts:1:22: The first export default is here.
@@ -6,6 +6,8 @@ tests/cases/conformance/externalModules/multipleExportDefault5.ts(2,22): error T
export default function bar() { }
~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/externalModules/multipleExportDefault5.ts:2:22: Another export default is here.
export default class C {}
~
!!! error TS2528: A module cannot have multiple default exports.
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/externalModules/multipleExportDefault5.ts:1:25: The first export default is here.
@@ -10,6 +10,7 @@ tests/cases/conformance/externalModules/multipleExportDefault6.ts(5,1): error TS
}
~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/externalModules/multipleExportDefault6.ts:5:1: Another export default is here.
export default {
~~~~~~~~~~~~~~~~
@@ -17,4 +18,5 @@ tests/cases/conformance/externalModules/multipleExportDefault6.ts(5,1): error TS
~~~~~~~~~~
}
~
!!! error TS2528: A module cannot have multiple default exports.
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/externalModules/multipleExportDefault6.ts:1:1: The first export default is here.
@@ -1,21 +1,21 @@
tests/cases/compiler/optionalParamArgsTest.ts(31,12): error TS2393: Duplicate function implementation.
tests/cases/compiler/optionalParamArgsTest.ts(34,12): error TS2393: Duplicate function implementation.
tests/cases/compiler/optionalParamArgsTest.ts(98,1): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/optionalParamArgsTest.ts(99,1): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/optionalParamArgsTest.ts(100,1): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/optionalParamArgsTest.ts(101,1): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/optionalParamArgsTest.ts(98,11): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/optionalParamArgsTest.ts(99,11): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/optionalParamArgsTest.ts(100,4): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/optionalParamArgsTest.ts(101,4): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/optionalParamArgsTest.ts(102,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/compiler/optionalParamArgsTest.ts(103,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/compiler/optionalParamArgsTest.ts(104,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/compiler/optionalParamArgsTest.ts(105,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/compiler/optionalParamArgsTest.ts(106,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/optionalParamArgsTest.ts(107,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/optionalParamArgsTest.ts(108,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/optionalParamArgsTest.ts(109,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/optionalParamArgsTest.ts(110,1): error TS2554: Expected 0-2 arguments, but got 3.
tests/cases/compiler/optionalParamArgsTest.ts(111,1): error TS2554: Expected 0-2 arguments, but got 3.
tests/cases/compiler/optionalParamArgsTest.ts(112,1): error TS2554: Expected 0-2 arguments, but got 3.
tests/cases/compiler/optionalParamArgsTest.ts(113,1): error TS2554: Expected 0-2 arguments, but got 3.
tests/cases/compiler/optionalParamArgsTest.ts(106,13): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/optionalParamArgsTest.ts(107,13): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/optionalParamArgsTest.ts(108,6): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/optionalParamArgsTest.ts(109,6): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/optionalParamArgsTest.ts(110,15): error TS2554: Expected 0-2 arguments, but got 3.
tests/cases/compiler/optionalParamArgsTest.ts(111,15): error TS2554: Expected 0-2 arguments, but got 3.
tests/cases/compiler/optionalParamArgsTest.ts(112,8): error TS2554: Expected 0-2 arguments, but got 3.
tests/cases/compiler/optionalParamArgsTest.ts(113,8): error TS2554: Expected 0-2 arguments, but got 3.
tests/cases/compiler/optionalParamArgsTest.ts(114,1): error TS2554: Expected 1-2 arguments, but got 0.
tests/cases/compiler/optionalParamArgsTest.ts(115,1): error TS2554: Expected 1-2 arguments, but got 0.
tests/cases/compiler/optionalParamArgsTest.ts(116,1): error TS2554: Expected 1-2 arguments, but got 0.
@@ -125,16 +125,16 @@ tests/cases/compiler/optionalParamArgsTest.ts(117,1): error TS2554: Expected 1-2
// Negative tests - we expect these cases to fail
c1o1.C1M1(1);
~~~~~~~~~~~~
~
!!! error TS2554: Expected 0 arguments, but got 1.
i1o1.C1M1(1);
~~~~~~~~~~~~
~
!!! error TS2554: Expected 0 arguments, but got 1.
F1(1);
~~~~~
~
!!! error TS2554: Expected 0 arguments, but got 1.
L1(1);
~~~~~
~
!!! error TS2554: Expected 0 arguments, but got 1.
c1o1.C1M2();
~~~~~~~~~~~
@@ -153,28 +153,28 @@ tests/cases/compiler/optionalParamArgsTest.ts(117,1): error TS2554: Expected 1-2
!!! error TS2554: Expected 1 arguments, but got 0.
!!! related TS6210 tests/cases/compiler/optionalParamArgsTest.ts:50:20: An argument for 'L2A1' was not provided.
c1o1.C1M2(1,2);
~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 1 arguments, but got 2.
i1o1.C1M2(1,2);
~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 1 arguments, but got 2.
F2(1,2);
~~~~~~~
~
!!! error TS2554: Expected 1 arguments, but got 2.
L2(1,2);
~~~~~~~
~
!!! error TS2554: Expected 1 arguments, but got 2.
c1o1.C1M3(1,2,3);
~~~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 0-2 arguments, but got 3.
i1o1.C1M3(1,2,3);
~~~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 0-2 arguments, but got 3.
F3(1,2,3);
~~~~~~~~~
~
!!! error TS2554: Expected 0-2 arguments, but got 3.
L3(1,2,3);
~~~~~~~~~
~
!!! error TS2554: Expected 0-2 arguments, but got 3.
c1o1.C1M4();
~~~~~~~~~~~
@@ -1,6 +1,6 @@
tests/cases/compiler/overload1.ts(27,5): error TS2322: Type 'C' is not assignable to type 'string'.
tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/compiler/overload1.ts(31,3): error TS2554: Expected 1-2 arguments, but got 3.
tests/cases/compiler/overload1.ts(31,11): error TS2554: Expected 1-2 arguments, but got 3.
tests/cases/compiler/overload1.ts(32,3): error TS2554: Expected 1-2 arguments, but got 0.
tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'.
tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type '2' is not assignable to parameter of type 'string'.
@@ -42,7 +42,7 @@ tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type '2' is n
!!! error TS2322: Type 'number' is not assignable to type 'string'.
var z:string=x.g(x.g(3,3)); // good
z=x.g(2,2,2); // no match
~~~~~~~~~~
~
!!! error TS2554: Expected 1-2 arguments, but got 3.
z=x.g(); // no match
~~~~~
@@ -1,11 +1,11 @@
tests/cases/compiler/overloadResolutionOnDefaultConstructor1.ts(3,16): error TS2554: Expected 0 arguments, but got 1.
tests/cases/compiler/overloadResolutionOnDefaultConstructor1.ts(3,24): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/compiler/overloadResolutionOnDefaultConstructor1.ts (1 errors) ====
class Bar {
public clone() {
return new Bar(0);
~~~~~~~~~~
~
!!! error TS2554: Expected 0 arguments, but got 1.
}
}
@@ -1,10 +1,9 @@
tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts(1,9): error TS2554: Expected 0 arguments, but got 1.
tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts(2,2): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts (1 errors) ====
var x = function () { }
~~~~~~~~~~~~~~~
(<any>window).foo;
~~~~~~~~~~~~~
~~~~~~~~~~~
!!! error TS2554: Expected 0 arguments, but got 1.
@@ -1,5 +1,5 @@
tests/cases/conformance/es6/restParameters/readonlyRestParameters.ts(8,5): error TS2556: Expected 2 arguments, but got 0 or more.
tests/cases/conformance/es6/restParameters/readonlyRestParameters.ts(20,5): error TS2554: Expected 2 arguments, but got 3.
tests/cases/conformance/es6/restParameters/readonlyRestParameters.ts(8,8): error TS2556: Expected 2 arguments, but got 0 or more.
tests/cases/conformance/es6/restParameters/readonlyRestParameters.ts(20,15): error TS2554: Expected 2 arguments, but got 3.
tests/cases/conformance/es6/restParameters/readonlyRestParameters.ts(25,5): error TS2542: Index signature in type 'readonly string[]' only permits reading.
@@ -12,7 +12,7 @@ tests/cases/conformance/es6/restParameters/readonlyRestParameters.ts(25,5): erro
function f1(...args: readonly string[]) {
f0(...args); // Error
~~~~~~~~~~~
~~~~~~~
!!! error TS2556: Expected 2 arguments, but got 0 or more.
!!! related TS6210 tests/cases/conformance/es6/restParameters/readonlyRestParameters.ts:1:13: An argument for 'a' was not provided.
f1('abc', 'def');
@@ -27,7 +27,7 @@ tests/cases/conformance/es6/restParameters/readonlyRestParameters.ts(25,5): erro
f1(...args);
f2('abc', 'def');
f2('abc', ...args); // Error
~~~~~~~~~~~~~~~~~~
~~~~~~~
!!! error TS2554: Expected 2 arguments, but got 3.
f2(...args);
}
@@ -8,9 +8,9 @@ tests/cases/compiler/recursiveFunctionTypes.ts(17,5): error TS2322: Type '() =>
tests/cases/compiler/recursiveFunctionTypes.ts(22,5): error TS2345: Argument of type '3' is not assignable to parameter of type '(t: typeof g) => void'.
tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2322: Type '3' is not assignable to type '() => any'.
tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: This overload signature is not compatible with its implementation signature.
tests/cases/compiler/recursiveFunctionTypes.ts(33,1): error TS2554: Expected 0-1 arguments, but got 2.
tests/cases/compiler/recursiveFunctionTypes.ts(33,8): error TS2554: Expected 0-1 arguments, but got 2.
tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'.
tests/cases/compiler/recursiveFunctionTypes.ts(42,1): error TS2554: Expected 0-1 arguments, but got 2.
tests/cases/compiler/recursiveFunctionTypes.ts(42,8): error TS2554: Expected 0-1 arguments, but got 2.
tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
@@ -68,7 +68,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of
function f6(a?: any) { return f6; }
f6("", 3); // error (arity mismatch)
~~~~~~~~~
~
!!! error TS2554: Expected 0-1 arguments, but got 2.
f6(""); // ok (function takes an any param)
~~
@@ -81,7 +81,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of
declare function f7(a?: typeof f7): typeof f7;
f7("", 3); // error (arity mismatch)
~~~~~~~~~
~
!!! error TS2554: Expected 0-1 arguments, but got 2.
f7(""); // ok (function takes an any param)
~~
@@ -11,9 +11,9 @@ conforms({ foo: (v: string) => false })({ foo: "hello" });
>conforms({ foo: (v: string) => false })({ foo: "hello" }) : boolean
>conforms({ foo: (v: string) => false }) : (value: { foo: string; }) => boolean
>conforms : <T>(source: { [K in keyof T]: (val: T[K]) => boolean; }) => (value: T) => boolean
>{ foo: (v: string) => false } : { foo: (v: string) => boolean; }
>foo : (v: string) => boolean
>(v: string) => false : (v: string) => boolean
>{ foo: (v: string) => false } : { foo: (v: string) => false; }
>foo : (v: string) => false
>(v: string) => false : (v: string) => false
>v : string
>false : false
>{ foo: "hello" } : { foo: string; }
@@ -1,7 +1,7 @@
tests/cases/conformance/functions/strictBindCallApply1.ts(11,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(17,11): error TS2554: Expected 3 arguments, but got 2.
tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(19,11): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(19,44): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(22,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
Property '1' is missing in type '[number]' but required in type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: Type 'number' is not assignable to type 'string'.
@@ -12,7 +12,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(41,29): error TS2345:
tests/cases/conformance/functions/strictBindCallApply1.ts(42,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
tests/cases/conformance/functions/strictBindCallApply1.ts(48,11): error TS2554: Expected 3 arguments, but got 2.
tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(50,11): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(50,38): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(51,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'.
@@ -21,7 +21,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345:
tests/cases/conformance/functions/strictBindCallApply1.ts(62,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(65,1): error TS2554: Expected 3 arguments, but got 2.
tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(67,1): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(67,24): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(70,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(71,17): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'.
@@ -53,7 +53,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345:
~~
!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
let c03 = foo.call(undefined, 10, "hello", 30); // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
!!! error TS2554: Expected 3 arguments, but got 4.
let a00 = foo.apply(undefined, [10, "hello"]);
@@ -103,7 +103,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345:
~~
!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
let c13 = c.foo.call(c, 10, "hello", 30); // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
!!! error TS2554: Expected 3 arguments, but got 4.
let c14 = c.foo.call(undefined, 10, "hello"); // Error
~~~~~~~~~
@@ -138,7 +138,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345:
~~
!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
C.call(c, 10, "hello", 30); // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
!!! error TS2554: Expected 3 arguments, but got 4.
C.apply(c, [10, "hello"]);
@@ -4,9 +4,9 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,9): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,9): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4.
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts (8 errors) ====
@@ -36,7 +36,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var f = foo([], 1, 2, 3); // any (with error)
~~~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 1-3 arguments, but got 4.
var u = foo ``; // number
@@ -47,6 +47,6 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
var y = foo `${1}${"2"}`; // {}
var z = foo `${1}${2}${3}`; // any (with error)
~~~~~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 1-3 arguments, but got 4.
@@ -4,9 +4,9 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,9): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,9): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4.
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts (8 errors) ====
@@ -36,7 +36,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var f = foo([], 1, 2, 3); // any (with error)
~~~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 1-3 arguments, but got 4.
var u = foo ``; // number
@@ -47,6 +47,6 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
var y = foo `${1}${"2"}`; // {}
var z = foo `${1}${2}${3}`; // any (with error)
~~~~~~~~~~~~~~~~~~
~
!!! error TS2554: Expected 1-3 arguments, but got 4.
@@ -1,7 +1,7 @@
tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts(5,1): error TS2554: Expected 3 arguments, but got 4.
tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts(5,24): error TS1109: Expression expected.
tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts(5,27): error TS1109: Expression expected.
tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts(5,28): error TS1005: '}' expected.
tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts(5,28): error TS2554: Expected 3 arguments, but got 4.
==== tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts (4 errors) ====
@@ -10,11 +10,11 @@ tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts(5,28):
// Incomplete call, but too many parameters.
f `123qdawdrqw${ 1 }${ }${
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 3 arguments, but got 4.
~
!!! error TS1109: Expression expected.
!!! error TS1109: Expression expected.
!!! error TS1005: '}' expected.
!!! error TS1005: '}' expected.
!!! error TS2554: Expected 3 arguments, but got 4.
@@ -1,6 +1,6 @@
tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts(5,1): error TS2554: Expected 3 arguments, but got 4.
tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts(5,29): error TS1109: Expression expected.
tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts(5,30): error TS1005: '}' expected.
tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts(5,30): error TS2554: Expected 3 arguments, but got 4.
==== tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts (3 errors) ====
@@ -9,9 +9,9 @@ tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts(5,30):
// Incomplete call, but too many parameters.
f `123qdawdrqw${ 1 }${ 2 }${
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 3 arguments, but got 4.
!!! error TS1109: Expression expected.
!!! error TS1005: '}' expected.
!!! error TS1005: '}' expected.
!!! error TS2554: Expected 3 arguments, but got 4.
@@ -12,7 +12,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(63,110): e
Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(65,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(66,6): error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(67,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(67,10): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(68,1): error TS2684: The 'this' context of type '{ y: string; f: (this: { y: number; }, x: number) => number; }' is not assignable to method's 'this' of type '{ y: number; }'.
Types of property 'y' are incompatible.
Type 'string' is not assignable to type 'number'.
@@ -20,16 +20,16 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(69,1): err
Property 'y' is missing in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }' but required in type '{ y: number; }'.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(72,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(73,13): error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(74,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(74,17): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(75,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(76,16): error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(77,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(77,20): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(78,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(79,16): error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(80,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(80,20): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(81,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(82,20): error TS2345: Argument of type '"wrong type 3"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(83,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(83,24): error TS2554: Expected 1 arguments, but got 2.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(86,5): error TS2322: Type '(this: { y: number; }, x: number) => number' is not assignable to type '(this: void, x: number) => number'.
The 'this' types of each signature are incompatible.
Type 'void' is not assignable to type '{ y: number; }'.
@@ -189,7 +189,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e
~~~~~~~~~~~~
!!! error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'.
ok.f(13, 'too many arguments');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
wrongPropertyType.f(13);
~~~~~~~~~~~~~~~~~
@@ -211,7 +211,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e
~~~~~~~~~~~~
!!! error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'.
c.explicitC(13, 'too many arguments');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
c.explicitThis(); // not enough arguments
~~~~~~~~~~~~~~~~
@@ -221,7 +221,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'.
c.explicitThis(14, 'too many arguments 2');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
c.implicitThis(); // not enough arguments
~~~~~~~~~~~~~~~~
@@ -231,7 +231,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'.
c.implicitThis(14, 'too many arguments 2');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
c.explicitProperty(); // not enough arguments
~~~~~~~~~~~~~~~~~~~~
@@ -241,7 +241,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '"wrong type 3"' is not assignable to parameter of type 'number'.
c.explicitProperty(15, 'too many arguments 3');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 2.
// oops, this triggers contextual typing, which needs to be updated to understand that =>'s `this` is void.
@@ -0,0 +1,759 @@
//// [/src/first/bin/first-output.js]
var s = "Hello, world";
console.log(s);
console.log(s);
console.log(f());
function f() {
return "JS does hoists";
}
//# sourceMappingURL=first-output.js.map
//// [/src/first/bin/first-output.js.map]
{"version":3,"file":"first-output.js","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACf,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACXf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC"}
//// [/src/first/bin/first-output.js.map.baseline.txt]
===================================================================
JsFile: first-output.js
mapUrl: first-output.js.map
sourceRoot:
sources: ../first_PART1.ts,../first_part2.ts,../first_part3.ts
===================================================================
-------------------------------------------------------------------
emittedFile:/src/first/bin/first-output.js
sourceFile:../first_PART1.ts
-------------------------------------------------------------------
>>>var s = "Hello, world";
1 >
2 >^^^^
3 > ^
4 > ^^^
5 > ^^^^^^^^^^^^^^
6 > ^
1 >interface TheFirst {
> none: any;
>}
>
>
2 >const
3 > s
4 > =
5 > "Hello, world"
6 > ;
1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(5, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(5, 8) + SourceIndex(0)
4 >Emitted(1, 9) Source(5, 11) + SourceIndex(0)
5 >Emitted(1, 23) Source(5, 25) + SourceIndex(0)
6 >Emitted(1, 24) Source(5, 26) + SourceIndex(0)
---
>>>console.log(s);
1 >
2 >^^^^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^
7 > ^
8 > ^
9 > ^->
1 >
>
>interface NoJsForHereEither {
> none: any;
>}
>
>
2 >console
3 > .
4 > log
5 > (
6 > s
7 > )
8 > ;
1 >Emitted(2, 1) Source(11, 1) + SourceIndex(0)
2 >Emitted(2, 8) Source(11, 8) + SourceIndex(0)
3 >Emitted(2, 9) Source(11, 9) + SourceIndex(0)
4 >Emitted(2, 12) Source(11, 12) + SourceIndex(0)
5 >Emitted(2, 13) Source(11, 13) + SourceIndex(0)
6 >Emitted(2, 14) Source(11, 14) + SourceIndex(0)
7 >Emitted(2, 15) Source(11, 15) + SourceIndex(0)
8 >Emitted(2, 16) Source(11, 16) + SourceIndex(0)
---
>>>console.log(s);
1->
2 >^^^^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^
7 > ^
8 > ^
9 > ^^^->
1->
>
2 >console
3 > .
4 > log
5 > (
6 > s
7 > )
8 > ;
1->Emitted(3, 1) Source(12, 1) + SourceIndex(0)
2 >Emitted(3, 8) Source(12, 8) + SourceIndex(0)
3 >Emitted(3, 9) Source(12, 9) + SourceIndex(0)
4 >Emitted(3, 12) Source(12, 12) + SourceIndex(0)
5 >Emitted(3, 13) Source(12, 13) + SourceIndex(0)
6 >Emitted(3, 14) Source(12, 14) + SourceIndex(0)
7 >Emitted(3, 15) Source(12, 15) + SourceIndex(0)
8 >Emitted(3, 16) Source(12, 16) + SourceIndex(0)
---
-------------------------------------------------------------------
emittedFile:/src/first/bin/first-output.js
sourceFile:../first_part2.ts
-------------------------------------------------------------------
>>>console.log(f());
1->
2 >^^^^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^
7 > ^^
8 > ^
9 > ^
1->
2 >console
3 > .
4 > log
5 > (
6 > f
7 > ()
8 > )
9 > ;
1->Emitted(4, 1) Source(1, 1) + SourceIndex(1)
2 >Emitted(4, 8) Source(1, 8) + SourceIndex(1)
3 >Emitted(4, 9) Source(1, 9) + SourceIndex(1)
4 >Emitted(4, 12) Source(1, 12) + SourceIndex(1)
5 >Emitted(4, 13) Source(1, 13) + SourceIndex(1)
6 >Emitted(4, 14) Source(1, 14) + SourceIndex(1)
7 >Emitted(4, 16) Source(1, 16) + SourceIndex(1)
8 >Emitted(4, 17) Source(1, 17) + SourceIndex(1)
9 >Emitted(4, 18) Source(1, 18) + SourceIndex(1)
---
-------------------------------------------------------------------
emittedFile:/src/first/bin/first-output.js
sourceFile:../first_part3.ts
-------------------------------------------------------------------
>>>function f() {
1 >
2 >^^^^^^^^^
3 > ^
4 > ^^^^^^^^^^^^^^^^^^^->
1 >
2 >function
3 > f
1 >Emitted(5, 1) Source(1, 1) + SourceIndex(2)
2 >Emitted(5, 10) Source(1, 10) + SourceIndex(2)
3 >Emitted(5, 11) Source(1, 11) + SourceIndex(2)
---
>>> return "JS does hoists";
1->^^^^
2 > ^^^^^^^
3 > ^^^^^^^^^^^^^^^^
4 > ^
1->() {
>
2 > return
3 > "JS does hoists"
4 > ;
1->Emitted(6, 5) Source(2, 5) + SourceIndex(2)
2 >Emitted(6, 12) Source(2, 12) + SourceIndex(2)
3 >Emitted(6, 28) Source(2, 28) + SourceIndex(2)
4 >Emitted(6, 29) Source(2, 29) + SourceIndex(2)
---
>>>}
1 >
2 >^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >}
1 >Emitted(7, 1) Source(3, 1) + SourceIndex(2)
2 >Emitted(7, 2) Source(3, 2) + SourceIndex(2)
---
>>>//# sourceMappingURL=first-output.js.map
//// [/src/first/bin/first-output.tsbuildinfo]
{
"bundle": {
"commonSourceDirectory": "/src/first/",
"sourceFiles": [
"/src/first/first_PART1.ts",
"/src/first/first_part2.ts",
"/src/first/first_part3.ts"
],
"js": {
"sections": [
{
"pos": 0,
"end": 127,
"kind": "text"
}
]
},
"dts": {
"sections": [
{
"pos": 0,
"end": 157,
"kind": "text"
}
]
}
},
"version": "FakeTSVersion"
}
//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt]
======================================================================
File:: /src/first/bin/first-output.js
----------------------------------------------------------------------
text: (0-127)
var s = "Hello, world";
console.log(s);
console.log(s);
console.log(f());
function f() {
return "JS does hoists";
}
======================================================================
======================================================================
File:: /src/first/bin/first-output.d.ts
----------------------------------------------------------------------
text: (0-157)
interface TheFirst {
none: any;
}
declare const s = "Hello, world";
interface NoJsForHereEither {
none: any;
}
declare function f(): string;
======================================================================
//// [/src/first/first_PART1.ts]
interface TheFirst {
none: any;
}
const s = "Hello, world";
interface NoJsForHereEither {
none: any;
}
console.log(s);
console.log(s);
//// [/src/third/thirdjs/output/third-output.js]
var s = "Hello, world";
console.log(s);
console.log(s);
console.log(f());
function f() {
return "JS does hoists";
}
var N;
(function (N) {
function f() {
console.log('testing');
}
f();
})(N || (N = {}));
var C = (function () {
function C() {
}
C.prototype.doSomething = function () {
console.log("something got done");
};
return C;
}());
var c = new C();
c.doSomething();
//# sourceMappingURL=third-output.js.map
//// [/src/third/thirdjs/output/third-output.js.map]
{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACf,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACXf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;ACED,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;ACJD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"}
//// [/src/third/thirdjs/output/third-output.js.map.baseline.txt]
===================================================================
JsFile: third-output.js
mapUrl: third-output.js.map
sourceRoot:
sources: ../../../first/first_PART1.ts,../../../first/first_part2.ts,../../../first/first_part3.ts,../../../second/second_part1.ts,../../../second/second_part2.ts,../../third_part1.ts
===================================================================
-------------------------------------------------------------------
emittedFile:/src/third/thirdjs/output/third-output.js
sourceFile:../../../first/first_PART1.ts
-------------------------------------------------------------------
>>>var s = "Hello, world";
1 >
2 >^^^^
3 > ^
4 > ^^^
5 > ^^^^^^^^^^^^^^
6 > ^
1 >interface TheFirst {
> none: any;
>}
>
>
2 >const
3 > s
4 > =
5 > "Hello, world"
6 > ;
1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(5, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(5, 8) + SourceIndex(0)
4 >Emitted(1, 9) Source(5, 11) + SourceIndex(0)
5 >Emitted(1, 23) Source(5, 25) + SourceIndex(0)
6 >Emitted(1, 24) Source(5, 26) + SourceIndex(0)
---
>>>console.log(s);
1 >
2 >^^^^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^
7 > ^
8 > ^
9 > ^->
1 >
>
>interface NoJsForHereEither {
> none: any;
>}
>
>
2 >console
3 > .
4 > log
5 > (
6 > s
7 > )
8 > ;
1 >Emitted(2, 1) Source(11, 1) + SourceIndex(0)
2 >Emitted(2, 8) Source(11, 8) + SourceIndex(0)
3 >Emitted(2, 9) Source(11, 9) + SourceIndex(0)
4 >Emitted(2, 12) Source(11, 12) + SourceIndex(0)
5 >Emitted(2, 13) Source(11, 13) + SourceIndex(0)
6 >Emitted(2, 14) Source(11, 14) + SourceIndex(0)
7 >Emitted(2, 15) Source(11, 15) + SourceIndex(0)
8 >Emitted(2, 16) Source(11, 16) + SourceIndex(0)
---
>>>console.log(s);
1->
2 >^^^^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^
7 > ^
8 > ^
9 > ^^^->
1->
>
2 >console
3 > .
4 > log
5 > (
6 > s
7 > )
8 > ;
1->Emitted(3, 1) Source(12, 1) + SourceIndex(0)
2 >Emitted(3, 8) Source(12, 8) + SourceIndex(0)
3 >Emitted(3, 9) Source(12, 9) + SourceIndex(0)
4 >Emitted(3, 12) Source(12, 12) + SourceIndex(0)
5 >Emitted(3, 13) Source(12, 13) + SourceIndex(0)
6 >Emitted(3, 14) Source(12, 14) + SourceIndex(0)
7 >Emitted(3, 15) Source(12, 15) + SourceIndex(0)
8 >Emitted(3, 16) Source(12, 16) + SourceIndex(0)
---
-------------------------------------------------------------------
emittedFile:/src/third/thirdjs/output/third-output.js
sourceFile:../../../first/first_part2.ts
-------------------------------------------------------------------
>>>console.log(f());
1->
2 >^^^^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^
7 > ^^
8 > ^
9 > ^
1->
2 >console
3 > .
4 > log
5 > (
6 > f
7 > ()
8 > )
9 > ;
1->Emitted(4, 1) Source(1, 1) + SourceIndex(1)
2 >Emitted(4, 8) Source(1, 8) + SourceIndex(1)
3 >Emitted(4, 9) Source(1, 9) + SourceIndex(1)
4 >Emitted(4, 12) Source(1, 12) + SourceIndex(1)
5 >Emitted(4, 13) Source(1, 13) + SourceIndex(1)
6 >Emitted(4, 14) Source(1, 14) + SourceIndex(1)
7 >Emitted(4, 16) Source(1, 16) + SourceIndex(1)
8 >Emitted(4, 17) Source(1, 17) + SourceIndex(1)
9 >Emitted(4, 18) Source(1, 18) + SourceIndex(1)
---
-------------------------------------------------------------------
emittedFile:/src/third/thirdjs/output/third-output.js
sourceFile:../../../first/first_part3.ts
-------------------------------------------------------------------
>>>function f() {
1 >
2 >^^^^^^^^^
3 > ^
4 > ^^^^^^^^^^^^^^^^^^^->
1 >
2 >function
3 > f
1 >Emitted(5, 1) Source(1, 1) + SourceIndex(2)
2 >Emitted(5, 10) Source(1, 10) + SourceIndex(2)
3 >Emitted(5, 11) Source(1, 11) + SourceIndex(2)
---
>>> return "JS does hoists";
1->^^^^
2 > ^^^^^^^
3 > ^^^^^^^^^^^^^^^^
4 > ^
1->() {
>
2 > return
3 > "JS does hoists"
4 > ;
1->Emitted(6, 5) Source(2, 5) + SourceIndex(2)
2 >Emitted(6, 12) Source(2, 12) + SourceIndex(2)
3 >Emitted(6, 28) Source(2, 28) + SourceIndex(2)
4 >Emitted(6, 29) Source(2, 29) + SourceIndex(2)
---
>>>}
1 >
2 >^
3 > ^^^^^^->
1 >
>
2 >}
1 >Emitted(7, 1) Source(3, 1) + SourceIndex(2)
2 >Emitted(7, 2) Source(3, 2) + SourceIndex(2)
---
-------------------------------------------------------------------
emittedFile:/src/third/thirdjs/output/third-output.js
sourceFile:../../../second/second_part1.ts
-------------------------------------------------------------------
>>>var N;
1->
2 >^^^^
3 > ^
4 > ^
5 > ^^^^^^^^^^->
1->namespace N {
> // Comment text
>}
>
>
2 >namespace
3 > N
4 > {
> function f() {
> console.log('testing');
> }
>
> f();
> }
1->Emitted(8, 1) Source(5, 1) + SourceIndex(3)
2 >Emitted(8, 5) Source(5, 11) + SourceIndex(3)
3 >Emitted(8, 6) Source(5, 12) + SourceIndex(3)
4 >Emitted(8, 7) Source(11, 2) + SourceIndex(3)
---
>>>(function (N) {
1->
2 >^^^^^^^^^^^
3 > ^
4 > ^^^^^^^->
1->
2 >namespace
3 > N
1->Emitted(9, 1) Source(5, 1) + SourceIndex(3)
2 >Emitted(9, 12) Source(5, 11) + SourceIndex(3)
3 >Emitted(9, 13) Source(5, 12) + SourceIndex(3)
---
>>> function f() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
4 > ^^^^^^^^^^^^^^^^^^->
1-> {
>
2 > function
3 > f
1->Emitted(10, 5) Source(6, 5) + SourceIndex(3)
2 >Emitted(10, 14) Source(6, 14) + SourceIndex(3)
3 >Emitted(10, 15) Source(6, 15) + SourceIndex(3)
---
>>> console.log('testing');
1->^^^^^^^^
2 > ^^^^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^^^^^^^^^
7 > ^
8 > ^
1->() {
>
2 > console
3 > .
4 > log
5 > (
6 > 'testing'
7 > )
8 > ;
1->Emitted(11, 9) Source(7, 9) + SourceIndex(3)
2 >Emitted(11, 16) Source(7, 16) + SourceIndex(3)
3 >Emitted(11, 17) Source(7, 17) + SourceIndex(3)
4 >Emitted(11, 20) Source(7, 20) + SourceIndex(3)
5 >Emitted(11, 21) Source(7, 21) + SourceIndex(3)
6 >Emitted(11, 30) Source(7, 30) + SourceIndex(3)
7 >Emitted(11, 31) Source(7, 31) + SourceIndex(3)
8 >Emitted(11, 32) Source(7, 32) + SourceIndex(3)
---
>>> }
1 >^^^^
2 > ^
3 > ^^^^->
1 >
>
2 > }
1 >Emitted(12, 5) Source(8, 5) + SourceIndex(3)
2 >Emitted(12, 6) Source(8, 6) + SourceIndex(3)
---
>>> f();
1->^^^^
2 > ^
3 > ^^
4 > ^
5 > ^^^^^^^^^^^->
1->
>
>
2 > f
3 > ()
4 > ;
1->Emitted(13, 5) Source(10, 5) + SourceIndex(3)
2 >Emitted(13, 6) Source(10, 6) + SourceIndex(3)
3 >Emitted(13, 8) Source(10, 8) + SourceIndex(3)
4 >Emitted(13, 9) Source(10, 9) + SourceIndex(3)
---
>>>})(N || (N = {}));
1->
2 >^
3 > ^^
4 > ^
5 > ^^^^^
6 > ^
7 > ^^^^^^^^
8 > ^^^^^->
1->
>
2 >}
3 >
4 > N
5 >
6 > N
7 > {
> function f() {
> console.log('testing');
> }
>
> f();
> }
1->Emitted(14, 1) Source(11, 1) + SourceIndex(3)
2 >Emitted(14, 2) Source(11, 2) + SourceIndex(3)
3 >Emitted(14, 4) Source(5, 11) + SourceIndex(3)
4 >Emitted(14, 5) Source(5, 12) + SourceIndex(3)
5 >Emitted(14, 10) Source(5, 11) + SourceIndex(3)
6 >Emitted(14, 11) Source(5, 12) + SourceIndex(3)
7 >Emitted(14, 19) Source(11, 2) + SourceIndex(3)
---
-------------------------------------------------------------------
emittedFile:/src/third/thirdjs/output/third-output.js
sourceFile:../../../second/second_part2.ts
-------------------------------------------------------------------
>>>var C = (function () {
1->
2 >^^^^^^^^^^^^^^^^^^^->
1->
1->Emitted(15, 1) Source(1, 1) + SourceIndex(4)
---
>>> function C() {
1->^^^^
2 > ^^->
1->
1->Emitted(16, 5) Source(1, 1) + SourceIndex(4)
---
>>> }
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->class C {
> doSomething() {
> console.log("something got done");
> }
>
2 > }
1->Emitted(17, 5) Source(5, 1) + SourceIndex(4)
2 >Emitted(17, 6) Source(5, 2) + SourceIndex(4)
---
>>> C.prototype.doSomething = function () {
1->^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^
4 > ^^^^^^^^^^^^^->
1->
2 > doSomething
3 >
1->Emitted(18, 5) Source(2, 5) + SourceIndex(4)
2 >Emitted(18, 28) Source(2, 16) + SourceIndex(4)
3 >Emitted(18, 31) Source(2, 5) + SourceIndex(4)
---
>>> console.log("something got done");
1->^^^^^^^^
2 > ^^^^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^^^^^^^^^^^^^^^^^^^^
7 > ^
8 > ^
1->doSomething() {
>
2 > console
3 > .
4 > log
5 > (
6 > "something got done"
7 > )
8 > ;
1->Emitted(19, 9) Source(3, 9) + SourceIndex(4)
2 >Emitted(19, 16) Source(3, 16) + SourceIndex(4)
3 >Emitted(19, 17) Source(3, 17) + SourceIndex(4)
4 >Emitted(19, 20) Source(3, 20) + SourceIndex(4)
5 >Emitted(19, 21) Source(3, 21) + SourceIndex(4)
6 >Emitted(19, 41) Source(3, 41) + SourceIndex(4)
7 >Emitted(19, 42) Source(3, 42) + SourceIndex(4)
8 >Emitted(19, 43) Source(3, 43) + SourceIndex(4)
---
>>> };
1 >^^^^
2 > ^
3 > ^^^^^^^^^->
1 >
>
2 > }
1 >Emitted(20, 5) Source(4, 5) + SourceIndex(4)
2 >Emitted(20, 6) Source(4, 6) + SourceIndex(4)
---
>>> return C;
1->^^^^
2 > ^^^^^^^^
1->
>
2 > }
1->Emitted(21, 5) Source(5, 1) + SourceIndex(4)
2 >Emitted(21, 13) Source(5, 2) + SourceIndex(4)
---
>>>}());
1 >
2 >^
3 >
4 > ^^^^
5 > ^^^^^^^^^^^^->
1 >
2 >}
3 >
4 > class C {
> doSomething() {
> console.log("something got done");
> }
> }
1 >Emitted(22, 1) Source(5, 1) + SourceIndex(4)
2 >Emitted(22, 2) Source(5, 2) + SourceIndex(4)
3 >Emitted(22, 2) Source(1, 1) + SourceIndex(4)
4 >Emitted(22, 6) Source(5, 2) + SourceIndex(4)
---
-------------------------------------------------------------------
emittedFile:/src/third/thirdjs/output/third-output.js
sourceFile:../../third_part1.ts
-------------------------------------------------------------------
>>>var c = new C();
1->
2 >^^^^
3 > ^
4 > ^^^
5 > ^^^^
6 > ^
7 > ^^
8 > ^
9 > ^->
1->
2 >var
3 > c
4 > =
5 > new
6 > C
7 > ()
8 > ;
1->Emitted(23, 1) Source(1, 1) + SourceIndex(5)
2 >Emitted(23, 5) Source(1, 5) + SourceIndex(5)
3 >Emitted(23, 6) Source(1, 6) + SourceIndex(5)
4 >Emitted(23, 9) Source(1, 9) + SourceIndex(5)
5 >Emitted(23, 13) Source(1, 13) + SourceIndex(5)
6 >Emitted(23, 14) Source(1, 14) + SourceIndex(5)
7 >Emitted(23, 16) Source(1, 16) + SourceIndex(5)
8 >Emitted(23, 17) Source(1, 17) + SourceIndex(5)
---
>>>c.doSomething();
1->
2 >^
3 > ^
4 > ^^^^^^^^^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^^^^^^^^^^^^->
1->
>
2 >c
3 > .
4 > doSomething
5 > ()
6 > ;
1->Emitted(24, 1) Source(2, 1) + SourceIndex(5)
2 >Emitted(24, 2) Source(2, 2) + SourceIndex(5)
3 >Emitted(24, 3) Source(2, 3) + SourceIndex(5)
4 >Emitted(24, 14) Source(2, 14) + SourceIndex(5)
5 >Emitted(24, 16) Source(2, 16) + SourceIndex(5)
6 >Emitted(24, 17) Source(2, 17) + SourceIndex(5)
---
>>>//# sourceMappingURL=third-output.js.map
@@ -21,7 +21,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(49,12): error TS2
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(55,45): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(56,12): error TS2555: Expected at least 1 arguments, but got 0.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(59,12): error TS2554: Expected 2 arguments, but got 1.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(61,12): error TS2554: Expected 2 arguments, but got 3.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(61,49): error TS2554: Expected 2 arguments, but got 3.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(62,45): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(63,12): error TS2554: Expected 2 arguments, but got 0.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(69,45): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
@@ -146,7 +146,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2
!!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:58:87: An argument for 'b' was not provided.
strOrNum = unionWithRestParameter2('hello', 10); // error no call signature
strOrNum = unionWithRestParameter2('hello', 10, 11); // error no call signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
!!! error TS2554: Expected 2 arguments, but got 3.
strOrNum = unionWithRestParameter2('hello', "hello"); // error no call signature
~~~~~~~
@@ -1,5 +1,5 @@
tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(23,1): error TS2554: Expected 2 arguments, but got 1.
tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(25,1): error TS2554: Expected 2 arguments, but got 3.
tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(25,18): error TS2554: Expected 2 arguments, but got 3.
==== tests/cases/conformance/types/union/unionTypeCallSignatures4.ts (2 errors) ====
@@ -31,6 +31,6 @@ tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(25,1): error TS2
!!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures4.ts:5:23: An argument for 'b' was not provided.
f12345("a", "b");
f12345("a", "b", "c"); // error
~~~~~~~~~~~~~~~~~~~~~
~~~
!!! error TS2554: Expected 2 arguments, but got 3.
@@ -21,7 +21,7 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(49,12): erro
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(55,49): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(56,12): error TS2555: Expected at least 1 arguments, but got 0.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(59,12): error TS2554: Expected 2 arguments, but got 1.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(61,12): error TS2554: Expected 2 arguments, but got 3.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(61,53): error TS2554: Expected 2 arguments, but got 3.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(62,49): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(63,12): error TS2554: Expected 2 arguments, but got 0.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(69,49): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
@@ -145,7 +145,7 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro
!!! related TS6210 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:58:95: An argument for 'b' was not provided.
strOrNum = new unionWithRestParameter2('hello', 10); // error no call signature
strOrNum = new unionWithRestParameter2('hello', 10, 11); // error no call signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
!!! error TS2554: Expected 2 arguments, but got 3.
strOrNum = new unionWithRestParameter2('hello', "hello"); // error no call signature
~~~~~~~
@@ -0,0 +1,5 @@
// Repro for #24694
// @noImplicitAny: true
declare function f<T extends object>(data: T, handlers: { [P in keyof T]: (value: T[P], prop: P) => void; }): void;
f({ data: 0 }, { data(value, key) {} });
@@ -0,0 +1,4 @@
// Repro for #17388
declare let x: {foo: undefined} & {new(...args: any[]): any};
new x();
@@ -0,0 +1,24 @@
// @strict: true
type TakeString = (s: string) => any;
// Various functions accepting an object whose properties are TakeString functions.
// Note these all use mapped types.
declare function mapped1<T extends {[P in string]: TakeString}>(obj: T): void;
declare function mapped2<T extends {[P in keyof T]: TakeString}>(obj: T): void;
declare function mapped3<T extends {[P in keyof any]: TakeString}>(obj: T): void;
declare function mapped4<T>(obj: T & {[P in keyof T]: TakeString}): void;
declare function mapped5<T, K extends keyof T>(obj: T & {[P in K]: TakeString}): void;
declare function mapped6<K extends string>(obj: {[P in K]: TakeString}): void;
declare function mapped7<K extends keyof any>(obj: {[P in K]: TakeString}): void;
declare function mapped8<K extends 'foo'>(obj: {[P in K]: TakeString}): void;
declare function mapped9<K extends 'foo'|'bar'>(obj: {[P in K]: TakeString}): void;
mapped1({foo: s => 42});
mapped2({foo: s => 42});
mapped3({foo: s => 42});
mapped4({foo: s => 42});
mapped5({foo: s => 42});
mapped6({foo: s => 42});
mapped7({foo: s => 42});
mapped8({foo: s => 42});
mapped9({foo: s => 42});
@@ -0,0 +1,37 @@
// @declaration: true
// @stripInternal:true
export class Foo {
constructor(
/** @internal */
public isInternal1: string,
/** @internal */ public isInternal2: string, /** @internal */
public isInternal3: string,
// @internal
public isInternal4: string,
// nothing
/** @internal */
public isInternal5: string,
/* @internal */ public isInternal6: string /* trailing */,
/* @internal */ public isInternal7: string, /** @internal */
// not work
public notInternal1: string,
// @internal
/* not work */
public notInternal2: string,
/* not work */
// @internal
/* not work */
public notInternal3: string,
) { }
}
export class Bar {
constructor(/* @internal */ public isInternal1: string) {}
}
export class Baz {
constructor(/* @internal */
public isInternal: string
) {}
}

Some files were not shown because too many files have changed in this diff Show More