Merge branch 'master' into jsdoc

This commit is contained in:
Andy Hanson
2017-05-19 08:14:52 -07:00
157 changed files with 4573 additions and 1147 deletions
+5 -5
View File
@@ -149,7 +149,7 @@ namespace ts {
inStrictMode = bindInStrictMode(file, opts);
classifiableNames = createMap<string>();
symbolCount = 0;
skipTransformFlagAggregation = isDeclarationFile(file);
skipTransformFlagAggregation = file.isDeclarationFile;
Symbol = objectAllocator.getSymbolConstructor();
@@ -182,7 +182,7 @@ namespace ts {
return bindSourceFile;
function bindInStrictMode(file: SourceFile, opts: CompilerOptions): boolean {
if ((opts.alwaysStrict === undefined ? opts.strict : opts.alwaysStrict) && !isDeclarationFile(file)) {
if ((opts.alwaysStrict === undefined ? opts.strict : opts.alwaysStrict) && !file.isDeclarationFile) {
// bind in strict mode source files with alwaysStrict option
return true;
}
@@ -2545,7 +2545,7 @@ namespace ts {
}
function bindFunctionDeclaration(node: FunctionDeclaration) {
if (!isDeclarationFile(file) && !isInAmbientContext(node)) {
if (!file.isDeclarationFile && !isInAmbientContext(node)) {
if (isAsyncFunction(node)) {
emitFlags |= NodeFlags.HasAsyncFunctions;
}
@@ -2562,7 +2562,7 @@ namespace ts {
}
function bindFunctionExpression(node: FunctionExpression) {
if (!isDeclarationFile(file) && !isInAmbientContext(node)) {
if (!file.isDeclarationFile && !isInAmbientContext(node)) {
if (isAsyncFunction(node)) {
emitFlags |= NodeFlags.HasAsyncFunctions;
}
@@ -2576,7 +2576,7 @@ namespace ts {
}
function bindPropertyOrMethodOrAccessor(node: Declaration, symbolFlags: SymbolFlags, symbolExcludes: SymbolFlags) {
if (!isDeclarationFile(file) && !isInAmbientContext(node) && isAsyncFunction(node)) {
if (!file.isDeclarationFile && !isInAmbientContext(node) && isAsyncFunction(node)) {
emitFlags |= NodeFlags.HasAsyncFunctions;
}
+355 -351
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -984,7 +984,7 @@ namespace ts {
const enumMemberValue = resolver.getConstantValue(node);
if (enumMemberValue !== undefined) {
write(" = ");
write(enumMemberValue.toString());
write(getTextOfConstantValue(enumMemberValue));
}
write(",");
writeLine();
@@ -1840,7 +1840,7 @@ namespace ts {
function writeReferencePath(referencedFile: SourceFile, addBundledFileReference: boolean, emitOnlyDtsFiles: boolean): boolean {
let declFileName: string;
let addedBundledEmitReference = false;
if (isDeclarationFile(referencedFile)) {
if (referencedFile.isDeclarationFile) {
// Declaration file, use declaration file name
declFileName = referencedFile.fileName;
}
+25 -1
View File
@@ -1067,7 +1067,7 @@
"category": "Error",
"code": 2345
},
"Supplied parameters do not match any signature of call target.": {
"Call target does not contain any signatures.": {
"category": "Error",
"code": 2346
},
@@ -1855,6 +1855,30 @@
"category": "Error",
"code": 2552
},
"Computed values are not permitted in an enum with string valued members.": {
"category": "Error",
"code": 2553
},
"Expected {0} arguments, but got {1}.": {
"category": "Error",
"code": 2554
},
"Expected at least {0} arguments, but got {1}.": {
"category": "Error",
"code": 2555
},
"Expected {0} arguments, but got a minimum of {1}.": {
"category": "Error",
"code": 2556
},
"Expected at least {0} arguments, but got a minimum of {1}.": {
"category": "Error",
"code": 2557
},
"Expected {0} type arguments, but got {1}.": {
"category": "Error",
"code": 2558
},
"JSX element attributes type '{0}' may not be a union type.": {
"category": "Error",
"code": 2600
+1 -1
View File
@@ -1154,7 +1154,7 @@ namespace ts {
// check if constant enum value is integer
const constantValue = getConstantValue(expression);
// isFinite handles cases when constantValue is undefined
return isFinite(constantValue)
return typeof constantValue === "number" && isFinite(constantValue)
&& Math.floor(constantValue) === constantValue
&& printerOptions.removeComments;
}
+2 -2
View File
@@ -2371,7 +2371,7 @@ namespace ts {
/**
* Sets the constant value to emit for an expression.
*/
export function setConstantValue(node: PropertyAccessExpression | ElementAccessExpression, value: number) {
export function setConstantValue(node: PropertyAccessExpression | ElementAccessExpression, value: string | number) {
const emitNode = getOrCreateEmitNode(node);
emitNode.constantValue = value;
return node;
@@ -3858,7 +3858,7 @@ namespace ts {
if (file.moduleName) {
return createLiteral(file.moduleName);
}
if (!isDeclarationFile(file) && (options.out || options.outFile)) {
if (!file.isDeclarationFile && (options.out || options.outFile)) {
return createLiteral(getExternalModuleNameFromPath(host, file.fileName));
}
return undefined;
+6 -7
View File
@@ -1309,7 +1309,7 @@ namespace ts {
}
function getDeclarationDiagnosticsForFile(sourceFile: SourceFile, cancellationToken: CancellationToken): Diagnostic[] {
return isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
return sourceFile.isDeclarationFile ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
}
function getOptionsDiagnostics(): Diagnostic[] {
@@ -1348,7 +1348,6 @@ namespace ts {
const isJavaScriptFile = isSourceFileJavaScript(file);
const isExternalModuleFile = isExternalModule(file);
const isDtsFile = isDeclarationFile(file);
let imports: LiteralExpression[];
let moduleAugmentations: LiteralExpression[];
@@ -1401,7 +1400,7 @@ namespace ts {
}
break;
case SyntaxKind.ModuleDeclaration:
if (isAmbientModule(<ModuleDeclaration>node) && (inAmbientModule || hasModifier(node, ModifierFlags.Ambient) || isDeclarationFile(file))) {
if (isAmbientModule(<ModuleDeclaration>node) && (inAmbientModule || hasModifier(node, ModifierFlags.Ambient) || file.isDeclarationFile)) {
const moduleName = <LiteralExpression>(<ModuleDeclaration>node).name;
// Ambient module declarations can be interpreted as augmentations for some existing external modules.
// This will happen in two cases:
@@ -1412,7 +1411,7 @@ namespace ts {
(moduleAugmentations || (moduleAugmentations = [])).push(moduleName);
}
else if (!inAmbientModule) {
if (isDtsFile) {
if (file.isDeclarationFile) {
// for global .d.ts files record name of ambient module
(ambientModules || (ambientModules = [])).push(moduleName.text);
}
@@ -1730,7 +1729,7 @@ namespace ts {
const absoluteRootDirectoryPath = host.getCanonicalFileName(getNormalizedAbsolutePath(rootDirectory, currentDirectory));
for (const sourceFile of sourceFiles) {
if (!isDeclarationFile(sourceFile)) {
if (!sourceFile.isDeclarationFile) {
const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir));
@@ -1843,13 +1842,13 @@ namespace ts {
const languageVersion = options.target || ScriptTarget.ES3;
const outFile = options.outFile || options.out;
const firstNonAmbientExternalModuleSourceFile = forEach(files, f => isExternalModule(f) && !isDeclarationFile(f) ? f : undefined);
const firstNonAmbientExternalModuleSourceFile = forEach(files, f => isExternalModule(f) && !f.isDeclarationFile ? f : undefined);
if (options.isolatedModules) {
if (options.module === ModuleKind.None && languageVersion < ScriptTarget.ES2015) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher));
}
const firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) && !isDeclarationFile(f) ? f : undefined);
const firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) && !f.isDeclarationFile ? f : undefined);
if (firstNonExternalModuleSourceFile) {
const span = getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);
programDiagnostics.add(createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided));
+1 -1
View File
@@ -165,7 +165,7 @@ namespace ts {
};
function transformRoot(node: T) {
return node && (!isSourceFile(node) || !isDeclarationFile(node)) ? transformation(node) : node;
return node && (!isSourceFile(node) || !node.isDeclarationFile) ? transformation(node) : node;
}
/**
+1 -1
View File
@@ -295,7 +295,7 @@ namespace ts {
return transformSourceFile;
function transformSourceFile(node: SourceFile) {
if (isDeclarationFile(node)) {
if (node.isDeclarationFile) {
return node;
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace ts {
return transformSourceFile;
function transformSourceFile(node: SourceFile) {
if (isDeclarationFile(node)) {
if (node.isDeclarationFile) {
return node;
}
+1 -1
View File
@@ -47,7 +47,7 @@ namespace ts {
return transformSourceFile;
function transformSourceFile(node: SourceFile) {
if (isDeclarationFile(node)) {
if (node.isDeclarationFile) {
return node;
}
+1 -1
View File
@@ -33,7 +33,7 @@ namespace ts {
return transformSourceFile;
function transformSourceFile(node: SourceFile) {
if (isDeclarationFile(node)) {
if (node.isDeclarationFile) {
return node;
}
+1 -2
View File
@@ -293,8 +293,7 @@ namespace ts {
return transformSourceFile;
function transformSourceFile(node: SourceFile) {
if (isDeclarationFile(node)
|| (node.transformFlags & TransformFlags.ContainsGenerator) === 0) {
if (node.isDeclarationFile || (node.transformFlags & TransformFlags.ContainsGenerator) === 0) {
return node;
}
+1 -1
View File
@@ -15,7 +15,7 @@ namespace ts {
* @param node A SourceFile node.
*/
function transformSourceFile(node: SourceFile) {
if (isDeclarationFile(node)) {
if (node.isDeclarationFile) {
return node;
}
+1 -1
View File
@@ -16,7 +16,7 @@ namespace ts {
return transformSourceFile;
function transformSourceFile(node: SourceFile) {
if (isDeclarationFile(node)) {
if (node.isDeclarationFile) {
return node;
}
+1 -1
View File
@@ -55,7 +55,7 @@ namespace ts {
* @param node The SourceFile node.
*/
function transformSourceFile(node: SourceFile) {
if (isDeclarationFile(node) || !(isExternalModule(node) || compilerOptions.isolatedModules)) {
if (node.isDeclarationFile || !(isExternalModule(node) || compilerOptions.isolatedModules)) {
return node;
}
+1 -3
View File
@@ -50,9 +50,7 @@ namespace ts {
* @param node The SourceFile node.
*/
function transformSourceFile(node: SourceFile) {
if (isDeclarationFile(node)
|| !(isExternalModule(node)
|| compilerOptions.isolatedModules)) {
if (node.isDeclarationFile || !(isExternalModule(node) || compilerOptions.isolatedModules)) {
return node;
}
+20 -15
View File
@@ -76,7 +76,7 @@ namespace ts {
* @param node A SourceFile node.
*/
function transformSourceFile(node: SourceFile) {
if (isDeclarationFile(node)) {
if (node.isDeclarationFile) {
return node;
}
@@ -2494,22 +2494,27 @@ namespace ts {
// we pass false as 'generateNameForComputedPropertyName' for a backward compatibility purposes
// old emitter always generate 'expression' part of the name as-is.
const name = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ false);
const valueExpression = transformEnumMemberDeclarationValue(member);
const innerAssignment = createAssignment(
createElementAccess(
currentNamespaceContainerName,
name
),
valueExpression
);
const outerAssignment = valueExpression.kind === SyntaxKind.StringLiteral ?
innerAssignment :
createAssignment(
createElementAccess(
currentNamespaceContainerName,
innerAssignment
),
name
);
return setTextRange(
createStatement(
setTextRange(
createAssignment(
createElementAccess(
currentNamespaceContainerName,
createAssignment(
createElementAccess(
currentNamespaceContainerName,
name
),
transformEnumMemberDeclarationValue(member)
)
),
name
),
outerAssignment,
member
)
),
@@ -3349,7 +3354,7 @@ namespace ts {
return node;
}
function tryGetConstEnumValue(node: Node): number {
function tryGetConstEnumValue(node: Node): string | number {
if (compilerOptions.isolatedModules) {
return undefined;
}
+25 -15
View File
@@ -2551,7 +2551,7 @@ namespace ts {
isUnknownSymbol(symbol: Symbol): boolean;
/* @internal */ getMergedSymbol(symbol: Symbol): Symbol;
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number | undefined;
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined;
isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean;
/** Follow all aliases to get the original symbol. */
getAliasedSymbol(symbol: Symbol): Symbol;
@@ -2587,6 +2587,7 @@ namespace ts {
/**
* For a union, will include a property if it's defined in *any* of the member types.
* So for `{ a } | { b }`, this will include both `a` and `b`.
* Does not include properties of primitive types.
*/
/* @internal */ getAllPossiblePropertiesOfType(type: Type): Symbol[];
}
@@ -2776,7 +2777,7 @@ namespace ts {
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, shouldComputeAliasToMarkVisible: boolean): SymbolAccessibilityResult;
isEntityNameVisible(entityName: EntityNameOrEntityNameExpression, enclosingDeclaration: Node): SymbolVisibilityResult;
// Returns the constant value this property access resolves to, or 'undefined' for a non-constant
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number;
getReferencedValueDeclaration(reference: Identifier): Declaration;
getTypeReferenceSerializationKind(typeName: EntityName, location?: Node): TypeReferenceSerializationKind;
isOptionalParameter(node: ParameterDeclaration): boolean;
@@ -2914,6 +2915,13 @@ namespace ts {
isDeclarationWithCollidingName?: boolean; // True if symbol is block scoped redeclaration
bindingElement?: BindingElement; // Binding element associated with property symbol
exportsSomeValue?: boolean; // True if module exports some value (not just types)
enumKind?: EnumKind; // Enum declaration classification
}
/* @internal */
export const enum EnumKind {
Numeric, // Numeric enum (each member has a TypeFlags.Enum type)
Literal // Literal enum (each member has a TypeFlags.EnumLiteral type)
}
/* @internal */
@@ -2986,7 +2994,7 @@ namespace ts {
resolvedSymbol?: Symbol; // Cached name resolution result
resolvedIndexInfo?: IndexInfo; // Cached indexing info resolution result
maybeTypePredicate?: boolean; // Cached check whether call expression might reference a type predicate
enumMemberValue?: number; // Constant value of enum member
enumMemberValue?: string | number; // Constant value of enum member
isVisible?: boolean; // Is this node visible
containsArgumentsReference?: boolean; // Whether a function-like declaration contains an 'arguments' reference
hasReportedStatementInAmbientContext?: boolean; // Cache boolean if we report statements in ambient context
@@ -3006,7 +3014,7 @@ namespace ts {
StringLiteral = 1 << 5,
NumberLiteral = 1 << 6,
BooleanLiteral = 1 << 7,
EnumLiteral = 1 << 8,
EnumLiteral = 1 << 8, // Always combined with StringLiteral, NumberLiteral, or Union
ESSymbol = 1 << 9, // Type of symbol primitive introduced in ES6
Void = 1 << 10,
Undefined = 1 << 11,
@@ -3032,7 +3040,7 @@ namespace ts {
/* @internal */
Nullable = Undefined | Null,
Literal = StringLiteral | NumberLiteral | BooleanLiteral | EnumLiteral,
Literal = StringLiteral | NumberLiteral | BooleanLiteral,
StringOrNumberLiteral = StringLiteral | NumberLiteral,
/* @internal */
DefinitelyFalsy = StringLiteral | NumberLiteral | BooleanLiteral | Void | Undefined | Null,
@@ -3040,9 +3048,9 @@ namespace ts {
/* @internal */
Intrinsic = Any | String | Number | Boolean | BooleanLiteral | ESSymbol | Void | Undefined | Null | Never | NonPrimitive,
/* @internal */
Primitive = String | Number | Boolean | Enum | ESSymbol | Void | Undefined | Null | Literal,
Primitive = String | Number | Boolean | Enum | EnumLiteral | ESSymbol | Void | Undefined | Null | Literal,
StringLike = String | StringLiteral | Index,
NumberLike = Number | NumberLiteral | Enum | EnumLiteral,
NumberLike = Number | NumberLiteral | Enum,
BooleanLike = Boolean | BooleanLiteral,
EnumLike = Enum | EnumLiteral,
UnionOrIntersection = Union | Intersection,
@@ -3081,19 +3089,21 @@ namespace ts {
// String literal types (TypeFlags.StringLiteral)
// Numeric literal types (TypeFlags.NumberLiteral)
export interface LiteralType extends Type {
text: string; // Text of literal
value: string | number; // Value of literal
freshType?: LiteralType; // Fresh version of type
regularType?: LiteralType; // Regular version of type
}
// Enum types (TypeFlags.Enum)
export interface EnumType extends Type {
memberTypes: EnumLiteralType[];
export interface StringLiteralType extends LiteralType {
value: string;
}
// Enum types (TypeFlags.EnumLiteral)
export interface EnumLiteralType extends LiteralType {
baseType: EnumType & UnionType; // Base enum type
export interface NumberLiteralType extends LiteralType {
value: number;
}
// Enum types (TypeFlags.Enum)
export interface EnumType extends Type {
}
export const enum ObjectFlags {
@@ -3961,7 +3971,7 @@ namespace ts {
commentRange?: TextRange; // The text range to use when emitting leading or trailing comments
sourceMapRange?: TextRange; // The text range to use when emitting leading or trailing source mappings
tokenSourceMapRanges?: TextRange[]; // The text range to use when emitting source mappings for tokens
constantValue?: number; // The constant value of an expression
constantValue?: string | number; // The constant value of an expression
externalHelpersModuleName?: Identifier; // The local name for an imported helpers module
helpers?: EmitHelper[]; // Emit helpers for the node
}
+6 -6
View File
@@ -350,6 +350,10 @@ namespace ts {
Debug.fail(`Literal kind '${node.kind}' not accounted for.`);
}
export function getTextOfConstantValue(value: string | number) {
return typeof value === "string" ? '"' + escapeNonAsciiString(value) + '"' : "" + value;
}
// Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__'
export function escapeIdentifier(identifier: string): string {
return identifier.length >= 2 && identifier.charCodeAt(0) === CharacterCodes._ && identifier.charCodeAt(1) === CharacterCodes._ ? "_" + identifier : identifier;
@@ -587,10 +591,6 @@ namespace ts {
return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined;
}
export function isDeclarationFile(file: SourceFile): boolean {
return file.isDeclarationFile;
}
export function isConstEnumDeclaration(node: Node): boolean {
return node.kind === SyntaxKind.EnumDeclaration && isConst(node);
}
@@ -2584,7 +2584,7 @@ namespace ts {
export function getExternalModuleNameFromDeclaration(host: EmitHost, resolver: EmitResolver, declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration | ModuleDeclaration): string {
const file = resolver.getExternalModuleFileFromDeclaration(declaration);
if (!file || isDeclarationFile(file)) {
if (!file || file.isDeclarationFile) {
return undefined;
}
return getResolvedExternalModuleName(host, file);
@@ -2657,7 +2657,7 @@ namespace ts {
/** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */
export function sourceFileMayBeEmitted(sourceFile: SourceFile, options: CompilerOptions, isSourceFileFromExternalLibrary: (file: SourceFile) => boolean) {
return !(options.noEmitForJsFiles && isSourceFileJavaScript(sourceFile)) && !isDeclarationFile(sourceFile) && !isSourceFileFromExternalLibrary(sourceFile);
return !(options.noEmitForJsFiles && isSourceFileJavaScript(sourceFile)) && !sourceFile.isDeclarationFile && !isSourceFileFromExternalLibrary(sourceFile);
}
/**
+1 -1
View File
@@ -372,7 +372,7 @@ class ProjectRunner extends RunnerBase {
const compilerOptions = compilerResult.program.getCompilerOptions();
ts.forEach(compilerResult.program.getSourceFiles(), sourceFile => {
if (ts.isDeclarationFile(sourceFile)) {
if (sourceFile.isDeclarationFile) {
allInputFiles.unshift({ emittedFileName: sourceFile.fileName, code: sourceFile.text });
}
else if (!(compilerOptions.outFile || compilerOptions.out)) {
+3
View File
@@ -283,6 +283,7 @@ namespace ts.server {
throttleWaitMilliseconds?: number;
globalPlugins?: string[];
pluginProbeLocations?: string[];
allowLocalPluginLoads?: boolean;
}
export class ProjectService {
@@ -342,6 +343,7 @@ namespace ts.server {
public readonly globalPlugins: ReadonlyArray<string>;
public readonly pluginProbeLocations: ReadonlyArray<string>;
public readonly allowLocalPluginLoads: boolean;
constructor(opts: ProjectServiceOptions) {
this.host = opts.host;
@@ -353,6 +355,7 @@ namespace ts.server {
this.eventHandler = opts.eventHandler;
this.globalPlugins = opts.globalPlugins || emptyArray;
this.pluginProbeLocations = opts.pluginProbeLocations || emptyArray;
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService");
+6
View File
@@ -873,6 +873,12 @@ namespace ts.server {
// ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
const searchPaths = [combinePaths(host.getExecutingFilePath(), "../../.."), ...this.projectService.pluginProbeLocations];
if (this.projectService.allowLocalPluginLoads) {
const local = getDirectoryPath(this.canonicalConfigFilePath);
this.projectService.logger.info(`Local plugin loading enabled; adding ${local} to search paths`);
searchPaths.unshift(local);
}
// Enable tsconfig-specified plugins
if (options.plugins) {
for (const pluginConfigEntry of options.plugins) {
+6 -2
View File
@@ -16,6 +16,7 @@ namespace ts.server {
telemetryEnabled: boolean;
globalPlugins: string[];
pluginProbeLocations: string[];
allowLocalPluginLoads: boolean;
}
const net: {
@@ -403,7 +404,8 @@ namespace ts.server {
logger,
canUseEvents,
globalPlugins: options.globalPlugins,
pluginProbeLocations: options.pluginProbeLocations});
pluginProbeLocations: options.pluginProbeLocations,
allowLocalPluginLoads: options.allowLocalPluginLoads });
if (telemetryEnabled && typingsInstaller) {
typingsInstaller.setTelemetrySender(this);
@@ -743,6 +745,7 @@ namespace ts.server {
const globalPlugins = (findArgument("--globalPlugins") || "").split(",");
const pluginProbeLocations = (findArgument("--pluginProbeLocations") || "").split(",");
const allowLocalPluginLoads = hasArgument("--allowLocalPluginLoads");
const useSingleInferredProject = hasArgument("--useSingleInferredProject");
const disableAutomaticTypingAcquisition = hasArgument("--disableAutomaticTypingAcquisition");
@@ -760,7 +763,8 @@ namespace ts.server {
telemetryEnabled,
logger,
globalPlugins,
pluginProbeLocations
pluginProbeLocations,
allowLocalPluginLoads
};
const ioSession = new IOSession(options);
+3 -1
View File
@@ -348,6 +348,7 @@ namespace ts.server {
globalPlugins?: string[];
pluginProbeLocations?: string[];
allowLocalPluginLoads?: boolean;
}
export class Session implements EventSender {
@@ -401,7 +402,8 @@ namespace ts.server {
throttleWaitMilliseconds,
eventHandler: this.eventHandler,
globalPlugins: opts.globalPlugins,
pluginProbeLocations: opts.pluginProbeLocations
pluginProbeLocations: opts.pluginProbeLocations,
allowLocalPluginLoads: opts.allowLocalPluginLoads
};
this.projectService = new ProjectService(settings);
this.gcTimer = new GcTimer(this.host, /*delay*/ 7000, this.logger);
+1 -1
View File
@@ -275,7 +275,7 @@ namespace ts.Completions {
}
}
else if (type.flags & TypeFlags.StringLiteral) {
const name = (<LiteralType>type).text;
const name = (<StringLiteralType>type).value;
if (!uniques.has(name)) {
uniques.set(name, true);
result.push({
+2 -1
View File
@@ -336,7 +336,8 @@ namespace ts.SymbolDisplay {
displayParts.push(spacePart());
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
displayParts.push(spacePart());
displayParts.push(displayPart(constantValue.toString(), SymbolDisplayPartKind.numericLiteral));
displayParts.push(displayPart(getTextOfConstantValue(constantValue),
typeof constantValue === "number" ? SymbolDisplayPartKind.numericLiteral : SymbolDisplayPartKind.stringLiteral));
}
}
}
@@ -1,4 +1,4 @@
tests/cases/conformance/Symbols/ES5SymbolProperty5.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/Symbols/ES5SymbolProperty5.ts(7,1): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/conformance/Symbols/ES5SymbolProperty5.ts (1 errors) ====
@@ -10,4 +10,4 @@ tests/cases/conformance/Symbols/ES5SymbolProperty5.ts(7,1): error TS2346: Suppli
(new C)[Symbol.iterator](0) // Should error
~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
@@ -1,8 +1,8 @@
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2322: Type 'Object' is not assignable to type 'RegExp'.
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
Property 'exec' is missing in type 'Object'.
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,17): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,17): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,17): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,17): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Type 'Object' is not assignable to type 'Error'.
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
Property 'name' is missing in type 'Object'.
@@ -19,10 +19,10 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Ty
var a: String = Object.create<Object>("");
~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var c: String = Object.create<Number>(1);
~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var w: Error = new Object();
~
@@ -1,5 +1,5 @@
tests/cases/compiler/baseCheck.ts(9,18): error TS2552: Cannot find name 'loc'. Did you mean 'ELoc'?
tests/cases/compiler/baseCheck.ts(17,53): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/baseCheck.ts(17,53): error TS2554: Expected 2 arguments, but got 1.
tests/cases/compiler/baseCheck.ts(17,59): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
tests/cases/compiler/baseCheck.ts(18,62): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
tests/cases/compiler/baseCheck.ts(19,59): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
@@ -30,7 +30,7 @@ tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'.
class D extends C { constructor(public z: number) { super(this.z) } } // too few params
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 2 arguments, but got 1.
~~~~
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
class E extends C { constructor(public z: number) { super(0, this.z) } }
@@ -98,8 +98,8 @@ var e3 = t3[2]; // any
>2 : 2
var e4 = t4[3]; // number
>e4 : number | E1 | E2
>t4[3] : number | E1 | E2
>e4 : number
>t4[3] : number
>t4 : [E1, E2, number]
>3 : 3
@@ -1,9 +1,9 @@
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(3,18): error TS2393: Duplicate function implementation.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(5,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(5,9): 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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(12,5): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(16,1): error TS2346: Supplied parameters do not match any signature of call target.
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(16,1): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts (6 errors) ====
@@ -15,7 +15,7 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(16,1): error T
foo();
foo(10); // not ok
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
}
else {
function foo() { } // duplicate function
@@ -24,14 +24,14 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(16,1): error T
foo();
foo(10); // not ok
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
}
foo(10); // not ok
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
foo();
}
foo(10);
foo(); // not ok - needs number
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,9 +1,9 @@
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(3,18): error TS2393: Duplicate function implementation.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(5,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(5,9): 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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(12,5): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(16,1): error TS2346: Supplied parameters do not match any signature of call target.
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(16,1): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts (6 errors) ====
@@ -15,7 +15,7 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(16,1): error T
foo();
foo(10); // not ok
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
}
else {
function foo() { } // duplicate
@@ -24,14 +24,14 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(16,1): error T
foo();
foo(10);// not ok
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
}
foo(10); // not ok
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
foo();
}
foo(10);
foo(); // not ok - needs number
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,9 +1,9 @@
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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(6,9): 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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(14,5): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(11,9): 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.
==== tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts (6 errors) ====
@@ -16,7 +16,7 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): e
foo();
foo(10); // not ok
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
}
else {
function foo() { } // Error to declare function in block scope
@@ -25,14 +25,14 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): e
foo();
foo(10); // not ok
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
}
foo(10);
foo(); // not ok - needs number
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
}
foo(10);
foo(); // not ok - needs number
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,7 +1,7 @@
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(6,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(11,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(14,5): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(17,1): error TS2346: Supplied parameters do not match any signature of call target.
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(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.
==== tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts (4 errors) ====
@@ -12,21 +12,21 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(17,1): e
foo();
foo(10); // not ok
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
}
else {
function foo() { }
foo();
foo(10); // not ok
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
}
foo(10);
foo(); // not ok
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
}
foo(10);
foo(); // not ok - needs number
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,17 +1,17 @@
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(5,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(6,11): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(9,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(10,11): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(13,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(14,11): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(21,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(22,11): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(28,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(29,11): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(36,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(37,11): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(43,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,11): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(5,10): error TS2558: Expected 2 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(6,11): error TS2558: Expected 2 type arguments, but got 3.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(9,10): error TS2558: Expected 2 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(10,11): error TS2558: Expected 2 type arguments, but got 3.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(13,10): error TS2558: Expected 2 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(14,11): error TS2558: Expected 2 type arguments, but got 3.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(21,10): error TS2558: Expected 2 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(22,11): error TS2558: Expected 2 type arguments, but got 3.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(28,10): error TS2558: Expected 2 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(29,11): error TS2558: Expected 2 type arguments, but got 3.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(36,10): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(37,11): error TS2558: Expected 0 type arguments, but got 3.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(43,10): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,11): error TS2558: Expected 0 type arguments, but got 3.
==== tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts (14 errors) ====
@@ -21,26 +21,26 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti
function f<T, U>(x: T, y: U): T { return null; }
var r1 = f<number>(1, '');
~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 1.
var r1b = f<number, string, number>(1, '');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 3.
var f2 = <T, U>(x: T, y: U): T => { return null; }
var r2 = f2<number>(1, '');
~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 1.
var r2b = f2<number, string, number>(1, '');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 3.
var f3: { <T, U>(x: T, y: U): T; }
var r3 = f3<number>(1, '');
~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 1.
var r3b = f3<number, string, number>(1, '');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 3.
class C {
f<T, U>(x: T, y: U): T {
@@ -49,10 +49,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti
}
var r4 = (new C()).f<number>(1, '');
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 1.
var r4b = (new C()).f<number, string, number>(1, '');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 3.
interface I {
f<T, U>(x: T, y: U): T;
@@ -60,10 +60,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti
var i: I;
var r5 = i.f<number>(1, '');
~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 1.
var r5b = i.f<number, string, number>(1, '');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 3.
class C2<T, U> {
f(x: T, y: U): T {
@@ -72,10 +72,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti
}
var r6 = (new C2()).f<number>(1, '');
~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var r6b = (new C2()).f<number, string, number>(1, '');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 3.
interface I2<T, U> {
f(x: T, y: U): T;
@@ -83,7 +83,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti
var i2: I2<number, string>;
var r7 = i2.f<number>(1, '');
~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var r7b = i2.f<number, string, number>(1, '');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 3.
@@ -1,10 +1,10 @@
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(5,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(8,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(11,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(18,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(24,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(31,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(37,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(5,9): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(8,10): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(11,10): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(18,10): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(24,10): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(31,10): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(37,10): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(40,10): error TS2347: Untyped function calls may not accept type arguments.
tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(43,10): error TS2347: Untyped function calls may not accept type arguments.
@@ -16,17 +16,17 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun
function f(x: number) { return null; }
var r = f<string>(1);
~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var f2 = (x: number) => { return null; }
var r2 = f2<string>(1);
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var f3: { (x: number): any; }
var r3 = f3<string>(1);
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
class C {
f(x: number) {
@@ -35,7 +35,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun
}
var r4 = (new C()).f<string>(1);
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
interface I {
f(x: number): any;
@@ -43,7 +43,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun
var i: I;
var r5 = i.f<string>(1);
~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
class C2 {
f(x: number) {
@@ -52,7 +52,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun
}
var r6 = (new C2()).f<string>(1);
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
interface I2 {
f(x: number);
@@ -60,7 +60,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun
var i2: I2;
var r7 = i2.f<string>(1);
~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var a;
var r8 = a<number>();
@@ -1,7 +1,7 @@
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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/callOnInstance.ts(7,19): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/callOnInstance.ts(7,19): 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.
@@ -18,9 +18,9 @@ tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an exp
var s2: string = (new D(1))();
~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
~~~~~~~~
!!! error TS2554: Expected 0 arguments, but got 1.
declare class C { constructor(value: number); }
(new C(1))(); // Error for calling an instance
@@ -0,0 +1,81 @@
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(30,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(31,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(32,13): 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(33,13): 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(34,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(35,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(36,1): error TS2556: Expected 1-3 arguments, but got a minimum of 0.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(37,1): error TS2556: Expected 1-3 arguments, but got a minimum of 0.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(38,1): error TS2556: Expected 1-3 arguments, but got a minimum of 0.
==== tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts (9 errors) ====
declare function all(a?: number, b?: number): void;
declare function weird(a?: number | string, b?: number | string): void;
declare function prefix(s: string, a?: number, b?: number): void;
declare function rest(s: string, a?: number, b?: number, ...rest: number[]): void;
declare function normal(s: string): void;
declare function thunk(): string;
declare var ns: number[];
declare var mixed: (number | string)[];
declare var tuple: [number, string];
// good
all(...ns)
weird(...ns)
weird(...mixed)
weird(...tuple)
prefix("a", ...ns)
rest("d", ...ns)
// this covers the arguments case
normal("g", ...ns)
normal("h", ...mixed)
normal("i", ...tuple)
thunk(...ns)
thunk(...mixed)
thunk(...tuple)
// bad
all(...mixed)
~~~~~~~~
!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
all(...tuple)
~~~~~~~~
!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
prefix("b", ...mixed)
~~~~~~~~
!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
prefix("c", ...tuple)
~~~~~~~~
!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
rest("e", ...mixed)
~~~~~~~~
!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
rest("f", ...tuple)
~~~~~~~~
!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
prefix(...ns) // required parameters are required
~~~~~~~~~~~~~
!!! error TS2556: Expected 1-3 arguments, but got a minimum of 0.
prefix(...mixed)
~~~~~~~~~~~~~~~~
!!! error TS2556: Expected 1-3 arguments, but got a minimum of 0.
prefix(...tuple)
~~~~~~~~~~~~~~~~
!!! error TS2556: Expected 1-3 arguments, but got a minimum of 0.
@@ -0,0 +1,66 @@
//// [callWithSpread2.ts]
declare function all(a?: number, b?: number): void;
declare function weird(a?: number | string, b?: number | string): void;
declare function prefix(s: string, a?: number, b?: number): void;
declare function rest(s: string, a?: number, b?: number, ...rest: number[]): void;
declare function normal(s: string): void;
declare function thunk(): string;
declare var ns: number[];
declare var mixed: (number | string)[];
declare var tuple: [number, string];
// good
all(...ns)
weird(...ns)
weird(...mixed)
weird(...tuple)
prefix("a", ...ns)
rest("d", ...ns)
// this covers the arguments case
normal("g", ...ns)
normal("h", ...mixed)
normal("i", ...tuple)
thunk(...ns)
thunk(...mixed)
thunk(...tuple)
// bad
all(...mixed)
all(...tuple)
prefix("b", ...mixed)
prefix("c", ...tuple)
rest("e", ...mixed)
rest("f", ...tuple)
prefix(...ns) // required parameters are required
prefix(...mixed)
prefix(...tuple)
//// [callWithSpread2.js]
// good
all.apply(void 0, ns);
weird.apply(void 0, ns);
weird.apply(void 0, mixed);
weird.apply(void 0, tuple);
prefix.apply(void 0, ["a"].concat(ns));
rest.apply(void 0, ["d"].concat(ns));
// this covers the arguments case
normal.apply(void 0, ["g"].concat(ns));
normal.apply(void 0, ["h"].concat(mixed));
normal.apply(void 0, ["i"].concat(tuple));
thunk.apply(void 0, ns);
thunk.apply(void 0, mixed);
thunk.apply(void 0, tuple);
// bad
all.apply(void 0, mixed);
all.apply(void 0, tuple);
prefix.apply(void 0, ["b"].concat(mixed));
prefix.apply(void 0, ["c"].concat(tuple));
rest.apply(void 0, ["e"].concat(mixed));
rest.apply(void 0, ["f"].concat(tuple));
prefix.apply(void 0, ns); // required parameters are required
prefix.apply(void 0, mixed);
prefix.apply(void 0, tuple);
@@ -1,5 +1,5 @@
tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(3,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(3,1): error TS2558: Expected 2 type arguments, but got 1.
tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(5,1): error TS2558: Expected 2 type arguments, but got 3.
==== tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts (2 errors) ====
@@ -7,8 +7,8 @@ tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(5,1): error TS2346: S
f<number>();
~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 1.
f<number, string>();
f<number, string, number>();
~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 3.
@@ -1,6 +1,6 @@
tests/cases/compiler/weird.js(1,1): error TS2304: Cannot find name 'someFunction'.
tests/cases/compiler/weird.js(1,23): error TS7006: Parameter 'BaseClass' implicitly has an 'any' type.
tests/cases/compiler/weird.js(6,13): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/weird.js(6,13): error TS2346: Call target does not contain any signatures.
tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly has an 'any' type.
@@ -16,7 +16,7 @@ tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly
constructor() {
super();
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2346: Call target does not contain any signatures.
this.foo = "bar";
}
_render(error) {
@@ -1,7 +1,7 @@
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(10,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(22,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(31,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(39,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(10,9): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(22,9): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(31,10): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(39,10): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts (4 errors) ====
@@ -16,7 +16,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseCl
var r = C;
var c = new C(); // error
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var c2 = new C(1); // ok
class Base2<T,U> {
@@ -30,7 +30,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseCl
var r2 = D;
var d = new D(); // error
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var d2 = new D(1); // ok
// specialized base class
@@ -41,7 +41,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseCl
var r3 = D2;
var d3 = new D(); // error
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var d4 = new D(1); // ok
class D3 extends Base2<string, number> {
@@ -51,5 +51,5 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseCl
var r4 = D3;
var d5 = new D(); // error
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var d6 = new D(1); // ok
@@ -1,9 +1,9 @@
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(6,13): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(15,14): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(21,13): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(31,13): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(40,14): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(46,13): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(6,13): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(15,14): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(21,13): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(31,13): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(40,14): error TS2554: Expected 1-2 arguments, but got 0.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(46,13): error TS2554: Expected 1-2 arguments, but got 0.
==== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts (6 errors) ====
@@ -14,7 +14,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
var c = new C(); // error
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var c2 = new C(''); // ok
class C2 {
@@ -25,7 +25,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
var c3 = new C2(); // error
~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var c4 = new C2(''); // ok
var c5 = new C2(1); // ok
@@ -33,7 +33,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
var d = new D(); // error
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var d2 = new D(1); // ok
var d3 = new D(''); // ok
}
@@ -45,7 +45,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
var c = new C(); // error
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var c2 = new C(''); // ok
class C2<T,U> {
@@ -56,7 +56,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
var c3 = new C2(); // error
~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1-2 arguments, but got 0.
var c4 = new C2(''); // ok
var c5 = new C2(1, 2); // ok
@@ -64,7 +64,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
var d = new D(); // error
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1-2 arguments, but got 0.
var d2 = new D(1); // ok
var d3 = new D(''); // ok
}
@@ -1,5 +1,5 @@
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts(7,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target.
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 (2 errors) ====
@@ -11,7 +11,7 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/cl
var c = new C();
var c2 = new C(null); // error
~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
class D<T extends Date> {
x = 2
@@ -21,4 +21,4 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/cl
var d = new D();
var d2 = new D(null); // error
~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
@@ -1,11 +1,11 @@
tests/cases/compiler/cloduleTest2.ts(4,13): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/cloduleTest2.ts(10,13): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/cloduleTest2.ts(4,13): error TS2554: Expected 1 arguments, but got 0.
tests/cases/compiler/cloduleTest2.ts(10,13): error TS2554: Expected 1 arguments, but got 0.
tests/cases/compiler/cloduleTest2.ts(18,7): error TS2339: Property 'bar' does not exist on type 'm3d'.
tests/cases/compiler/cloduleTest2.ts(19,7): error TS2339: Property 'y' does not exist on type 'm3d'.
tests/cases/compiler/cloduleTest2.ts(27,7): error TS2339: Property 'bar' does not exist on type 'm3d'.
tests/cases/compiler/cloduleTest2.ts(28,7): error TS2339: Property 'y' does not exist on type 'm3d'.
tests/cases/compiler/cloduleTest2.ts(33,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/cloduleTest2.ts(36,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/cloduleTest2.ts(33,9): error TS2554: Expected 1 arguments, but got 0.
tests/cases/compiler/cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/compiler/cloduleTest2.ts (8 errors) ====
@@ -14,7 +14,7 @@ tests/cases/compiler/cloduleTest2.ts(36,10): error TS2346: Supplied parameters d
declare class m3d { constructor(foo); foo(): void ; static bar(); }
var r = new m3d(); // error
~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
}
module T2 {
@@ -22,7 +22,7 @@ tests/cases/compiler/cloduleTest2.ts(36,10): error TS2346: Supplied parameters d
module m3d { export var y = 2; }
var r = new m3d(); // error
~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
}
module T3 {
@@ -55,9 +55,9 @@ tests/cases/compiler/cloduleTest2.ts(36,10): error TS2346: Supplied parameters d
declare class m3d { constructor(foo); foo(): void; static bar(); }
var r = new m3d(); // error
~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
declare class m4d extends m3d { }
var r2 = new m4d(); // error
~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(4,2): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts (2 errors) ====
@@ -10,5 +10,5 @@ tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(4,2): erro
}
(new S18(123)).S18 = 0;
~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0 arguments, but got 1.
@@ -12,7 +12,7 @@ var o = {
>{ [E1.x || E2.x]: 0} : { [x: number]: number; }
[E1.x || E2.x]: 0
>E1.x || E2.x : E1 | E2
>E1.x || E2.x : E2
>E1.x : E1
>E1 : typeof E1
>x : E1
@@ -12,7 +12,7 @@ var o = {
>{ [E1.x || E2.x]: 0} : { [x: number]: number; }
[E1.x || E2.x]: 0
>E1.x || E2.x : E1 | E2
>E1.x || E2.x : E2
>E1.x : E1
>E1 : typeof E1
>x : E1
@@ -1,4 +1,4 @@
tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts(9,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts(9,9): error TS2558: Expected 2 type arguments, but got 1.
==== tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts (1 errors) ====
@@ -12,5 +12,5 @@ tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts(9,9): error TS23
var d = new D<number>();
~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 1.
@@ -1,5 +1,5 @@
tests/cases/compiler/couldNotSelectGenericOverload.ts(3,11): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/couldNotSelectGenericOverload.ts(7,11): error TS2346: Supplied parameters do not match any signature of call target.
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 (2 errors) ====
@@ -7,11 +7,11 @@ tests/cases/compiler/couldNotSelectGenericOverload.ts(7,11): error TS2346: Suppl
var b = [1, ""];
var b1G = makeArray(1, ""); // any, no error
~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! 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 TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 2.
@@ -1,5 +1,4 @@
tests/cases/conformance/decorators/class/decoratorOnClass8.ts(3,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/decorators/class/decoratorOnClass8.ts (1 errors) ====
@@ -8,6 +7,5 @@ tests/cases/conformance/decorators/class/decoratorOnClass8.ts(3,1): error TS1238
@dec()
~~~~~~
!!! error TS1238: Unable to resolve signature of class decorator when called as an expression.
!!! error TS1238: Supplied parameters do not match any signature of call target.
class C {
}
@@ -1,5 +1,4 @@
tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1241: Unable to resolve signature of method decorator when called as an expression.
Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts (1 errors) ====
@@ -9,5 +8,4 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5):
@dec ["method"]() {}
~~~~
!!! error TS1241: Unable to resolve signature of method decorator when called as an expression.
!!! error TS1241: Supplied parameters do not match any signature of call target.
}
@@ -1,5 +1,4 @@
tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts(4,5): error TS1241: Unable to resolve signature of method decorator when called as an expression.
Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts (1 errors) ====
@@ -9,5 +8,4 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts(4,5):
@dec method() {}
~~~~
!!! error TS1241: Unable to resolve signature of method decorator when called as an expression.
!!! error TS1241: Supplied parameters do not match any signature of call target.
}
@@ -1,5 +1,4 @@
tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1240: Unable to resolve signature of property decorator when called as an expression.
Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts (1 errors) ====
@@ -9,5 +8,4 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(
@dec prop;
~~~~
!!! error TS1240: Unable to resolve signature of property decorator when called as an expression.
!!! error TS1240: Supplied parameters do not match any signature of call target.
}
@@ -1,5 +1,4 @@
tests/cases/conformance/decorators/class/property/decoratorOnClassProperty6.ts(4,5): error TS1240: Unable to resolve signature of property decorator when called as an expression.
Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty6.ts (1 errors) ====
@@ -9,5 +8,4 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty6.ts(4
@dec prop;
~~~~
!!! error TS1240: Unable to resolve signature of property decorator when called as an expression.
!!! error TS1240: Supplied parameters do not match any signature of call target.
}
@@ -1,5 +1,4 @@
tests/cases/conformance/decorators/class/property/decoratorOnClassProperty7.ts(4,5): error TS1240: Unable to resolve signature of property decorator when called as an expression.
Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty7.ts (1 errors) ====
@@ -9,5 +8,4 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty7.ts(4
@dec prop;
~~~~
!!! error TS1240: Unable to resolve signature of property decorator when called as an expression.
!!! error TS1240: Supplied parameters do not match any signature of call target.
}
@@ -1,5 +1,5 @@
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts(11,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts(24,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts(11,9): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts(24,9): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts (2 errors) ====
@@ -15,7 +15,7 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
var r = new Derived(); // error
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var r2 = new Derived(1);
class Base2<T> {
@@ -30,5 +30,5 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
var d = new D(); // error
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var d2 = new D(new Date()); // ok
@@ -1,5 +1,5 @@
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts(13,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts(30,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts(13,9): error TS2554: Expected 1-3 arguments, but got 0.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts(30,9): error TS2554: Expected 1-3 arguments, but got 0.
==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts (2 errors) ====
@@ -17,7 +17,7 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
var r = new Derived(); // error
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1-3 arguments, but got 0.
var r2 = new Derived(1);
var r3 = new Derived(1, 2);
var r4 = new Derived(1, 2, 3);
@@ -36,7 +36,7 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
var d = new D(); // error
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1-3 arguments, but got 0.
var d2 = new D(new Date()); // ok
var d3 = new D(new Date(), new Date());
var d4 = new D(new Date(), new Date(), new Date());
@@ -1,7 +1,7 @@
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(22,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(44,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(45,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(21,9): error TS2554: Expected 2 arguments, but got 0.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(22,10): error TS2554: Expected 2 arguments, but got 1.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(44,9): error TS2554: Expected 2 arguments, but got 0.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(45,10): error TS2554: Expected 2 arguments, but got 1.
==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts (4 errors) ====
@@ -27,10 +27,10 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
var r = new Derived(); // error
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 2 arguments, but got 0.
var r2 = new Derived2(1); // error
~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 2 arguments, but got 1.
var r3 = new Derived('', '');
class Base2<T> {
@@ -54,8 +54,8 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
var d = new D2(); // error
~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 2 arguments, but got 0.
var d2 = new D2(new Date()); // error
~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 2 arguments, but got 1.
var d3 = new D2(new Date(), new Date()); // ok
@@ -1,4 +1,4 @@
tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts(13,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts(13,1): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts (1 errors) ====
@@ -16,4 +16,4 @@ tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts(13,1): erro
var y: MyClass = new MyClass();
y.myMethod(); // error
~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,4 +1,4 @@
tests/cases/compiler/emptyTypeArgumentList.ts(2,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/emptyTypeArgumentList.ts(2,1): error TS2558: Expected 1 type arguments, but got 0.
tests/cases/compiler/emptyTypeArgumentList.ts(2,4): error TS1099: Type argument list cannot be empty.
@@ -6,6 +6,6 @@ tests/cases/compiler/emptyTypeArgumentList.ts(2,4): error TS1099: Type argument
function foo<T>() { }
foo<>();
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 1 type arguments, but got 0.
~~
!!! error TS1099: Type argument list cannot be empty.
@@ -1,4 +1,4 @@
tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,1): error TS2558: Expected 1 type arguments, but got 0.
tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,8): error TS1099: Type argument list cannot be empty.
@@ -6,6 +6,6 @@ tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,8): error TS1099: Type ar
class foo<T> { }
new foo<>();
~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 1 type arguments, but got 0.
~~
!!! error TS1099: Type argument list cannot be empty.
@@ -1,15 +1,19 @@
tests/cases/compiler/enumAssignmentCompat3.ts(68,1): error TS2324: Property 'd' is missing in type 'First.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(68,1): error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'.
Property 'd' is missing in type 'First.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(70,1): error TS2322: Type 'Cd.E' is not assignable to type 'First.E'.
Property 'd' is missing in type 'First.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(71,1): error TS2322: Type 'Nope' is not assignable to type 'E'.
tests/cases/compiler/enumAssignmentCompat3.ts(72,1): error TS2322: Type 'Decl.E' is not assignable to type 'First.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(75,1): error TS2324: Property 'c' is missing in type 'Ab.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(75,1): error TS2322: Type 'First.E' is not assignable to type 'Ab.E'.
Property 'c' is missing in type 'Ab.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(76,1): error TS2322: Type 'First.E' is not assignable to type 'Cd.E'.
Property 'a' is missing in type 'Cd.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(77,1): error TS2322: Type 'E' is not assignable to type 'Nope'.
tests/cases/compiler/enumAssignmentCompat3.ts(78,1): error TS2322: Type 'First.E' is not assignable to type 'Decl.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(82,1): error TS2322: Type 'Const.E' is not assignable to type 'First.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(83,1): error TS2322: Type 'First.E' is not assignable to type 'Const.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2324: Property 'd' is missing in type 'First.E'.
tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged.E' is not assignable to type 'First.E'.
Property 'd' is missing in type 'First.E'.
==== tests/cases/compiler/enumAssignmentCompat3.ts (11 errors) ====
@@ -82,7 +86,8 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2324: Property 'd'
abc = secondAbc; // ok
abc = secondAbcd; // missing 'd'
~~~
!!! error TS2324: Property 'd' is missing in type 'First.E'.
!!! error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'.
!!! error TS2322: Property 'd' is missing in type 'First.E'.
abc = secondAb; // ok
abc = secondCd; // missing 'd'
~~~
@@ -98,10 +103,12 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2324: Property 'd'
secondAbcd = abc; // ok
secondAb = abc; // missing 'c'
~~~~~~~~
!!! error TS2324: Property 'c' is missing in type 'Ab.E'.
!!! error TS2322: Type 'First.E' is not assignable to type 'Ab.E'.
!!! error TS2322: Property 'c' is missing in type 'Ab.E'.
secondCd = abc; // missing 'a' and 'b'
~~~~~~~~
!!! error TS2322: Type 'First.E' is not assignable to type 'Cd.E'.
!!! error TS2322: Property 'a' is missing in type 'Cd.E'.
nope = abc; // nope!
~~~~
!!! error TS2322: Type 'E' is not assignable to type 'Nope'.
@@ -121,7 +128,8 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2324: Property 'd'
// merged enums compare all their members
abc = merged; // missing 'd'
~~~
!!! error TS2324: Property 'd' is missing in type 'First.E'.
!!! error TS2322: Type 'Merged.E' is not assignable to type 'First.E'.
!!! error TS2322: Property 'd' is missing in type 'First.E'.
merged = abc; // ok
abc = merged2; // ok
merged2 = abc; // ok
@@ -1,86 +0,0 @@
tests/cases/conformance/enums/enumBasics.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'e' must be of type 'typeof E1', but here has type '{ readonly [n: number]: string; readonly A: E1; readonly B: E1; readonly C: E1; }'.
==== tests/cases/conformance/enums/enumBasics.ts (1 errors) ====
// Enum without initializers have first member = 0 and successive members = N + 1
enum E1 {
A,
B,
C
}
// Enum type is a subtype of Number
var x: number = E1.A;
// Enum object type is anonymous with properties of the enum type and numeric indexer
var e = E1;
var e: {
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'e' must be of type 'typeof E1', but here has type '{ readonly [n: number]: string; readonly A: E1; readonly B: E1; readonly C: E1; }'.
readonly A: E1;
readonly B: E1;
readonly C: E1;
readonly [n: number]: string;
};
var e: typeof E1;
// Reverse mapping of enum returns string name of property
var s = E1[e.A];
var s: string;
// Enum with only constant members
enum E2 {
A = 1, B = 2, C = 3
}
// Enum with only computed members
enum E3 {
X = 'foo'.length, Y = 4 + 3, Z = +'foo'
}
// Enum with constant members followed by computed members
enum E4 {
X = 0, Y, Z = 'foo'.length
}
// Enum with > 2 constant members with no initializer for first member, non zero initializer for second element
enum E5 {
A,
B = 3,
C // 4
}
enum E6 {
A,
B = 0,
C // 1
}
// Enum with computed member initializer of type 'any'
enum E7 {
A = 'foo'['foo']
}
// Enum with computed member initializer of type number
enum E8 {
B = 'foo'['foo']
}
//Enum with computed member intializer of same enum type
enum E9 {
A,
B = A
}
// (refer to .js to validate)
// Enum constant members are propagated
var doNotPropagate = [
E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z
];
// Enum computed members are not propagated
var doPropagate = [
E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C
];
+3 -3
View File
@@ -12,9 +12,9 @@ var x: number = E1.A;
// Enum object type is anonymous with properties of the enum type and numeric indexer
var e = E1;
var e: {
readonly A: E1;
readonly B: E1;
readonly C: E1;
readonly A: E1.A;
readonly B: E1.B;
readonly C: E1.C;
readonly [n: number]: string;
};
var e: typeof E1;
+8 -5
View File
@@ -28,17 +28,20 @@ var e = E1;
var e: {
>e : Symbol(e, Decl(enumBasics.ts, 11, 3), Decl(enumBasics.ts, 12, 3), Decl(enumBasics.ts, 18, 3))
readonly A: E1;
readonly A: E1.A;
>A : Symbol(A, Decl(enumBasics.ts, 12, 8))
>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0))
>A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9))
readonly B: E1;
>B : Symbol(B, Decl(enumBasics.ts, 13, 19))
readonly B: E1.B;
>B : Symbol(B, Decl(enumBasics.ts, 13, 21))
>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0))
>B : Symbol(E1.B, Decl(enumBasics.ts, 2, 6))
readonly C: E1;
>C : Symbol(C, Decl(enumBasics.ts, 14, 19))
readonly C: E1.C;
>C : Symbol(C, Decl(enumBasics.ts, 14, 21))
>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0))
>C : Symbol(E1.C, Decl(enumBasics.ts, 3, 6))
readonly [n: number]: string;
>n : Symbol(n, Decl(enumBasics.ts, 16, 14))
+57 -54
View File
@@ -4,21 +4,21 @@ enum E1 {
>E1 : E1
A,
>A : E1
>A : E1.A
B,
>B : E1
>B : E1.B
C
>C : E1
>C : E1.C
}
// Enum type is a subtype of Number
var x: number = E1.A;
>x : number
>E1.A : E1
>E1.A : E1.A
>E1 : typeof E1
>A : E1
>A : E1.A
// Enum object type is anonymous with properties of the enum type and numeric indexer
var e = E1;
@@ -28,17 +28,20 @@ var e = E1;
var e: {
>e : typeof E1
readonly A: E1;
>A : E1
>E1 : E1
readonly A: E1.A;
>A : E1.A
>E1 : any
>A : E1.A
readonly B: E1;
>B : E1
>E1 : E1
readonly B: E1.B;
>B : E1.B
>E1 : any
>B : E1.B
readonly C: E1;
>C : E1
>E1 : E1
readonly C: E1.C;
>C : E1.C
>E1 : any
>C : E1.C
readonly [n: number]: string;
>n : number
@@ -53,9 +56,9 @@ var s = E1[e.A];
>s : string
>E1[e.A] : string
>E1 : typeof E1
>e.A : E1
>e.A : E1.A
>e : typeof E1
>A : E1
>A : E1.A
var s: string;
>s : string
@@ -66,12 +69,12 @@ enum E2 {
>E2 : E2
A = 1, B = 2, C = 3
>A : E2
>1 : number
>B : E2
>2 : number
>C : E2
>3 : number
>A : E2.A
>1 : 1
>B : E2.B
>2 : 2
>C : E2.C
>3 : 3
}
// Enum with only computed members
@@ -81,15 +84,15 @@ enum E3 {
X = 'foo'.length, Y = 4 + 3, Z = +'foo'
>X : E3
>'foo'.length : number
>'foo' : string
>'foo' : "foo"
>length : number
>Y : E3
>4 + 3 : number
>4 : number
>3 : number
>4 : 4
>3 : 3
>Z : E3
>+'foo' : number
>'foo' : string
>'foo' : "foo"
}
// Enum with constant members followed by computed members
@@ -98,11 +101,11 @@ enum E4 {
X = 0, Y, Z = 'foo'.length
>X : E4
>0 : number
>0 : 0
>Y : E4
>Z : E4
>'foo'.length : number
>'foo' : string
>'foo' : "foo"
>length : number
}
@@ -111,28 +114,28 @@ enum E5 {
>E5 : E5
A,
>A : E5
>A : E5.A
B = 3,
>B : E5
>3 : number
>B : E5.B
>3 : 3
C // 4
>C : E5
>C : E5.C
}
enum E6 {
>E6 : E6
A,
>A : E6
>A : E6.A
B = 0,
>B : E6
>0 : number
>B : E6.A
>0 : 0
C // 1
>C : E6
>C : E6.C
}
// Enum with computed member initializer of type 'any'
@@ -142,8 +145,8 @@ enum E7 {
A = 'foo'['foo']
>A : E7
>'foo'['foo'] : any
>'foo' : string
>'foo' : string
>'foo' : "foo"
>'foo' : "foo"
}
// Enum with computed member initializer of type number
@@ -153,8 +156,8 @@ enum E8 {
B = 'foo'['foo']
>B : E8
>'foo'['foo'] : any
>'foo' : string
>'foo' : string
>'foo' : "foo"
>'foo' : "foo"
}
//Enum with computed member intializer of same enum type
@@ -198,8 +201,8 @@ var doNotPropagate = [
];
// Enum computed members are not propagated
var doPropagate = [
>doPropagate : (E5 | E6 | E9)[]
>[ E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C] : (E5 | E6 | E9)[]
>doPropagate : (E9 | E6 | E5)[]
>[ E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C] : (E9 | E6 | E5)[]
E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C
>E9.A : E9
@@ -208,24 +211,24 @@ var doPropagate = [
>E9.B : E9
>E9 : typeof E9
>B : E9
>E6.B : E6
>E6.B : E6.A
>E6 : typeof E6
>B : E6
>E6.C : E6
>B : E6.A
>E6.C : E6.C
>E6 : typeof E6
>C : E6
>E6.A : E6
>C : E6.C
>E6.A : E6.A
>E6 : typeof E6
>A : E6
>E5.A : E5
>A : E6.A
>E5.A : E5.A
>E5 : typeof E5
>A : E5
>E5.B : E5
>A : E5.A
>E5.B : E5.B
>E5 : typeof E5
>B : E5
>E5.C : E5
>B : E5.B
>E5.C : E5.C
>E5 : typeof E5
>C : E5
>C : E5.C
];
@@ -0,0 +1,218 @@
//// [enumClassification.ts]
// An enum type where each member has no initializer or an initializer that specififes
// a numeric literal, a string literal, or a single identifier naming another member in
// the enum type is classified as a literal enum type. An enum type that doesn't adhere
// to this pattern is classified as a numeric enum type.
// Examples of literal enum types
enum E01 {
A
}
enum E02 {
A = 123
}
enum E03 {
A = "hello"
}
enum E04 {
A,
B,
C
}
enum E05 {
A,
B = 10,
C
}
enum E06 {
A = "one",
B = "two",
C = "three"
}
enum E07 {
A,
B,
C = "hi",
D = 10,
E,
F = "bye"
}
enum E08 {
A = 10,
B = "hello",
C = A,
D = B,
E = C,
}
// Examples of numeric enum types with only constant members
enum E10 {}
enum E11 {
A = +0,
B,
C
}
enum E12 {
A = 1 << 0,
B = 1 << 1,
C = 1 << 2
}
// Examples of numeric enum types with constant and computed members
enum E20 {
A = "foo".length,
B = A + 1,
C = +"123",
D = Math.sin(1)
}
//// [enumClassification.js]
// An enum type where each member has no initializer or an initializer that specififes
// a numeric literal, a string literal, or a single identifier naming another member in
// the enum type is classified as a literal enum type. An enum type that doesn't adhere
// to this pattern is classified as a numeric enum type.
// Examples of literal enum types
var E01;
(function (E01) {
E01[E01["A"] = 0] = "A";
})(E01 || (E01 = {}));
var E02;
(function (E02) {
E02[E02["A"] = 123] = "A";
})(E02 || (E02 = {}));
var E03;
(function (E03) {
E03["A"] = "hello";
})(E03 || (E03 = {}));
var E04;
(function (E04) {
E04[E04["A"] = 0] = "A";
E04[E04["B"] = 1] = "B";
E04[E04["C"] = 2] = "C";
})(E04 || (E04 = {}));
var E05;
(function (E05) {
E05[E05["A"] = 0] = "A";
E05[E05["B"] = 10] = "B";
E05[E05["C"] = 11] = "C";
})(E05 || (E05 = {}));
var E06;
(function (E06) {
E06["A"] = "one";
E06["B"] = "two";
E06["C"] = "three";
})(E06 || (E06 = {}));
var E07;
(function (E07) {
E07[E07["A"] = 0] = "A";
E07[E07["B"] = 1] = "B";
E07["C"] = "hi";
E07[E07["D"] = 10] = "D";
E07[E07["E"] = 11] = "E";
E07["F"] = "bye";
})(E07 || (E07 = {}));
var E08;
(function (E08) {
E08[E08["A"] = 10] = "A";
E08["B"] = "hello";
E08[E08["C"] = 10] = "C";
E08["D"] = "hello";
E08[E08["E"] = 10] = "E";
})(E08 || (E08 = {}));
// Examples of numeric enum types with only constant members
var E10;
(function (E10) {
})(E10 || (E10 = {}));
var E11;
(function (E11) {
E11[E11["A"] = 0] = "A";
E11[E11["B"] = 1] = "B";
E11[E11["C"] = 2] = "C";
})(E11 || (E11 = {}));
var E12;
(function (E12) {
E12[E12["A"] = 1] = "A";
E12[E12["B"] = 2] = "B";
E12[E12["C"] = 4] = "C";
})(E12 || (E12 = {}));
// Examples of numeric enum types with constant and computed members
var E20;
(function (E20) {
E20[E20["A"] = "foo".length] = "A";
E20[E20["B"] = E20.A + 1] = "B";
E20[E20["C"] = +"123"] = "C";
E20[E20["D"] = Math.sin(1)] = "D";
})(E20 || (E20 = {}));
//// [enumClassification.d.ts]
declare enum E01 {
A = 0,
}
declare enum E02 {
A = 123,
}
declare enum E03 {
A = "hello",
}
declare enum E04 {
A = 0,
B = 1,
C = 2,
}
declare enum E05 {
A = 0,
B = 10,
C = 11,
}
declare enum E06 {
A = "one",
B = "two",
C = "three",
}
declare enum E07 {
A = 0,
B = 1,
C = "hi",
D = 10,
E = 11,
F = "bye",
}
declare enum E08 {
A = 10,
B = "hello",
C = 10,
D = "hello",
E = 10,
}
declare enum E10 {
}
declare enum E11 {
A = 0,
B = 1,
C = 2,
}
declare enum E12 {
A = 1,
B = 2,
C = 4,
}
declare enum E20 {
A,
B,
C,
D,
}
@@ -0,0 +1,167 @@
=== tests/cases/conformance/enums/enumClassification.ts ===
// An enum type where each member has no initializer or an initializer that specififes
// a numeric literal, a string literal, or a single identifier naming another member in
// the enum type is classified as a literal enum type. An enum type that doesn't adhere
// to this pattern is classified as a numeric enum type.
// Examples of literal enum types
enum E01 {
>E01 : Symbol(E01, Decl(enumClassification.ts, 0, 0))
A
>A : Symbol(E01.A, Decl(enumClassification.ts, 7, 10))
}
enum E02 {
>E02 : Symbol(E02, Decl(enumClassification.ts, 9, 1))
A = 123
>A : Symbol(E02.A, Decl(enumClassification.ts, 11, 10))
}
enum E03 {
>E03 : Symbol(E03, Decl(enumClassification.ts, 13, 1))
A = "hello"
>A : Symbol(E03.A, Decl(enumClassification.ts, 15, 10))
}
enum E04 {
>E04 : Symbol(E04, Decl(enumClassification.ts, 17, 1))
A,
>A : Symbol(E04.A, Decl(enumClassification.ts, 19, 10))
B,
>B : Symbol(E04.B, Decl(enumClassification.ts, 20, 6))
C
>C : Symbol(E04.C, Decl(enumClassification.ts, 21, 6))
}
enum E05 {
>E05 : Symbol(E05, Decl(enumClassification.ts, 23, 1))
A,
>A : Symbol(E05.A, Decl(enumClassification.ts, 25, 10))
B = 10,
>B : Symbol(E05.B, Decl(enumClassification.ts, 26, 6))
C
>C : Symbol(E05.C, Decl(enumClassification.ts, 27, 11))
}
enum E06 {
>E06 : Symbol(E06, Decl(enumClassification.ts, 29, 1))
A = "one",
>A : Symbol(E06.A, Decl(enumClassification.ts, 31, 10))
B = "two",
>B : Symbol(E06.B, Decl(enumClassification.ts, 32, 14))
C = "three"
>C : Symbol(E06.C, Decl(enumClassification.ts, 33, 14))
}
enum E07 {
>E07 : Symbol(E07, Decl(enumClassification.ts, 35, 1))
A,
>A : Symbol(E07.A, Decl(enumClassification.ts, 37, 10))
B,
>B : Symbol(E07.B, Decl(enumClassification.ts, 38, 6))
C = "hi",
>C : Symbol(E07.C, Decl(enumClassification.ts, 39, 6))
D = 10,
>D : Symbol(E07.D, Decl(enumClassification.ts, 40, 13))
E,
>E : Symbol(E07.E, Decl(enumClassification.ts, 41, 11))
F = "bye"
>F : Symbol(E07.F, Decl(enumClassification.ts, 42, 6))
}
enum E08 {
>E08 : Symbol(E08, Decl(enumClassification.ts, 44, 1))
A = 10,
>A : Symbol(E08.A, Decl(enumClassification.ts, 46, 10))
B = "hello",
>B : Symbol(E08.B, Decl(enumClassification.ts, 47, 11))
C = A,
>C : Symbol(E08.C, Decl(enumClassification.ts, 48, 16))
>A : Symbol(E08.A, Decl(enumClassification.ts, 46, 10))
D = B,
>D : Symbol(E08.D, Decl(enumClassification.ts, 49, 10))
>B : Symbol(E08.B, Decl(enumClassification.ts, 47, 11))
E = C,
>E : Symbol(E08.E, Decl(enumClassification.ts, 50, 10))
>C : Symbol(E08.C, Decl(enumClassification.ts, 48, 16))
}
// Examples of numeric enum types with only constant members
enum E10 {}
>E10 : Symbol(E10, Decl(enumClassification.ts, 52, 1))
enum E11 {
>E11 : Symbol(E11, Decl(enumClassification.ts, 56, 11))
A = +0,
>A : Symbol(E11.A, Decl(enumClassification.ts, 58, 10))
B,
>B : Symbol(E11.B, Decl(enumClassification.ts, 59, 11))
C
>C : Symbol(E11.C, Decl(enumClassification.ts, 60, 6))
}
enum E12 {
>E12 : Symbol(E12, Decl(enumClassification.ts, 62, 1))
A = 1 << 0,
>A : Symbol(E12.A, Decl(enumClassification.ts, 64, 10))
B = 1 << 1,
>B : Symbol(E12.B, Decl(enumClassification.ts, 65, 15))
C = 1 << 2
>C : Symbol(E12.C, Decl(enumClassification.ts, 66, 15))
}
// Examples of numeric enum types with constant and computed members
enum E20 {
>E20 : Symbol(E20, Decl(enumClassification.ts, 68, 1))
A = "foo".length,
>A : Symbol(E20.A, Decl(enumClassification.ts, 72, 10))
>"foo".length : Symbol(String.length, Decl(lib.d.ts, --, --))
>length : Symbol(String.length, Decl(lib.d.ts, --, --))
B = A + 1,
>B : Symbol(E20.B, Decl(enumClassification.ts, 73, 21))
>A : Symbol(E20.A, Decl(enumClassification.ts, 72, 10))
C = +"123",
>C : Symbol(E20.C, Decl(enumClassification.ts, 74, 14))
D = Math.sin(1)
>D : Symbol(E20.D, Decl(enumClassification.ts, 75, 15))
>Math.sin : Symbol(Math.sin, Decl(lib.d.ts, --, --))
>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>sin : Symbol(Math.sin, Decl(lib.d.ts, --, --))
}
@@ -0,0 +1,196 @@
=== tests/cases/conformance/enums/enumClassification.ts ===
// An enum type where each member has no initializer or an initializer that specififes
// a numeric literal, a string literal, or a single identifier naming another member in
// the enum type is classified as a literal enum type. An enum type that doesn't adhere
// to this pattern is classified as a numeric enum type.
// Examples of literal enum types
enum E01 {
>E01 : E01
A
>A : E01
}
enum E02 {
>E02 : E02
A = 123
>A : E02
>123 : 123
}
enum E03 {
>E03 : E03
A = "hello"
>A : E03
>"hello" : "hello"
}
enum E04 {
>E04 : E04
A,
>A : E04.A
B,
>B : E04.B
C
>C : E04.C
}
enum E05 {
>E05 : E05
A,
>A : E05.A
B = 10,
>B : E05.B
>10 : 10
C
>C : E05.C
}
enum E06 {
>E06 : E06
A = "one",
>A : E06.A
>"one" : "one"
B = "two",
>B : E06.B
>"two" : "two"
C = "three"
>C : E06.C
>"three" : "three"
}
enum E07 {
>E07 : E07
A,
>A : E07.A
B,
>B : E07.B
C = "hi",
>C : E07.C
>"hi" : "hi"
D = 10,
>D : E07.D
>10 : 10
E,
>E : E07.E
F = "bye"
>F : E07.F
>"bye" : "bye"
}
enum E08 {
>E08 : E08
A = 10,
>A : E08.A
>10 : 10
B = "hello",
>B : E08.B
>"hello" : "hello"
C = A,
>C : E08.A
>A : E08.A
D = B,
>D : E08.B
>B : E08.B
E = C,
>E : E08.A
>C : E08.A
}
// Examples of numeric enum types with only constant members
enum E10 {}
>E10 : E10
enum E11 {
>E11 : E11
A = +0,
>A : E11
>+0 : number
>0 : 0
B,
>B : E11
C
>C : E11
}
enum E12 {
>E12 : E12
A = 1 << 0,
>A : E12
>1 << 0 : number
>1 : 1
>0 : 0
B = 1 << 1,
>B : E12
>1 << 1 : number
>1 : 1
>1 : 1
C = 1 << 2
>C : E12
>1 << 2 : number
>1 : 1
>2 : 2
}
// Examples of numeric enum types with constant and computed members
enum E20 {
>E20 : E20
A = "foo".length,
>A : E20
>"foo".length : number
>"foo" : "foo"
>length : number
B = A + 1,
>B : E20
>A + 1 : number
>A : E20
>1 : 1
C = +"123",
>C : E20
>+"123" : number
>"123" : "123"
D = Math.sin(1)
>D : E20
>Math.sin(1) : number
>Math.sin : (x: number) => number
>Math : Math
>sin : (x: number) => number
>1 : 1
}
@@ -3,13 +3,17 @@ tests/cases/conformance/enums/enumErrors.ts(3,6): error TS2431: Enum name cannot
tests/cases/conformance/enums/enumErrors.ts(4,6): error TS2431: Enum name cannot be 'string'.
tests/cases/conformance/enums/enumErrors.ts(5,6): error TS2431: Enum name cannot be 'boolean'.
tests/cases/conformance/enums/enumErrors.ts(9,9): error TS2322: Type 'Number' is not assignable to type 'E5'.
tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type '""' is not assignable to type 'E11'.
tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type 'true' is not assignable to type 'E11'.
tests/cases/conformance/enums/enumErrors.ts(27,9): error TS2322: Type 'Date' is not assignable to type 'E11'.
tests/cases/conformance/enums/enumErrors.ts(28,9): error TS2304: Cannot find name 'window'.
tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is not assignable to type 'E11'.
tests/cases/conformance/enums/enumErrors.ts(35,9): error TS2553: Computed values are not permitted in an enum with string valued members.
tests/cases/conformance/enums/enumErrors.ts(36,9): error TS2553: Computed values are not permitted in an enum with string valued members.
tests/cases/conformance/enums/enumErrors.ts(37,9): error TS2553: Computed values are not permitted in an enum with string valued members.
tests/cases/conformance/enums/enumErrors.ts(38,9): error TS2553: Computed values are not permitted in an enum with string valued members.
==== tests/cases/conformance/enums/enumErrors.ts (9 errors) ====
==== tests/cases/conformance/enums/enumErrors.ts (13 errors) ====
// Enum named with PredefinedTypes
enum any { }
~~~
@@ -45,9 +49,9 @@ tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is no
// Enum with computed member intializer of other types
enum E11 {
A = '',
~~
!!! error TS2322: Type '""' is not assignable to type 'E11'.
A = true,
~~~~
!!! error TS2322: Type 'true' is not assignable to type 'E11'.
B = new Date(),
~~~~~~~~~~
!!! error TS2322: Type 'Date' is not assignable to type 'E11'.
@@ -58,4 +62,21 @@ tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is no
~~
!!! error TS2322: Type '{}' is not assignable to type 'E11'.
}
// Enum with string valued member and computed member initializers
enum E12 {
A = '',
B = new Date(),
~~~~~~~~~~
!!! error TS2553: Computed values are not permitted in an enum with string valued members.
C = window,
~~~~~~
!!! error TS2553: Computed values are not permitted in an enum with string valued members.
D = {},
~~
!!! error TS2553: Computed values are not permitted in an enum with string valued members.
E = 1 + 1,
~~~~~
!!! error TS2553: Computed values are not permitted in an enum with string valued members.
}
+20 -2
View File
@@ -24,11 +24,20 @@ enum E10 {
// Enum with computed member intializer of other types
enum E11 {
A = '',
A = true,
B = new Date(),
C = window,
D = {}
}
// Enum with string valued member and computed member initializers
enum E12 {
A = '',
B = new Date(),
C = window,
D = {},
E = 1 + 1,
}
//// [enumErrors.js]
@@ -65,8 +74,17 @@ var E10;
// Enum with computed member intializer of other types
var E11;
(function (E11) {
E11[E11["A"] = ''] = "A";
E11[E11["A"] = true] = "A";
E11[E11["B"] = new Date()] = "B";
E11[E11["C"] = window] = "C";
E11[E11["D"] = {}] = "D";
})(E11 || (E11 = {}));
// Enum with string valued member and computed member initializers
var E12;
(function (E12) {
E12["A"] = "";
E12[E12["B"] = 0] = "B";
E12[E12["C"] = 0] = "C";
E12[E12["D"] = 0] = "D";
E12[E12["E"] = 0] = "E";
})(E12 || (E12 = {}));
@@ -1,4 +1,4 @@
tests/cases/compiler/errorForwardReferenceForwadingConstructor.ts(4,14): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/errorForwardReferenceForwadingConstructor.ts(4,14): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/compiler/errorForwardReferenceForwadingConstructor.ts (1 errors) ====
@@ -7,7 +7,7 @@ tests/cases/compiler/errorForwardReferenceForwadingConstructor.ts(4,14): error T
function f() {
var d1 = new derived();
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
var d2 = new derived(4);
}
@@ -19,11 +19,11 @@ var E1;
(function (E1) {
// illegal case
// forward reference to the element of the same enum
E1[E1["X"] = E1.Y] = "X";
E1[E1["X1"] = E1["Y"]] = "X1";
E1[E1["X"] = 0] = "X";
E1[E1["X1"] = 0] = "X1";
// forward reference to the element of the same enum
E1[E1["Y"] = E1.Z] = "Y";
E1[E1["Y1"] = E1["Z"]] = "Y1";
E1[E1["Y"] = 0] = "Y";
E1[E1["Y1"] = 0] = "Y1";
})(E1 || (E1 = {}));
(function (E1) {
E1[E1["Z"] = 4] = "Z";
@@ -1,6 +1,6 @@
tests/cases/compiler/functionCall11.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target.
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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall11.ts(6,1): error TS2554: Expected 1-2 arguments, but got 3.
==== tests/cases/compiler/functionCall11.ts (3 errors) ====
@@ -9,11 +9,11 @@ tests/cases/compiler/functionCall11.ts(6,1): error TS2346: Supplied parameters d
foo('foo');
foo();
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1-2 arguments, but got 0.
foo(1, 'bar');
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
foo('foo', 1, 'bar');
~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1-2 arguments, but got 3.
@@ -1,4 +1,4 @@
tests/cases/compiler/functionCall12.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall12.ts(4,1): error TS2554: Expected 1-3 arguments, but got 0.
tests/cases/compiler/functionCall12.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
tests/cases/compiler/functionCall12.ts(7,15): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
@@ -9,7 +9,7 @@ tests/cases/compiler/functionCall12.ts(7,15): error TS2345: Argument of type '3'
foo('foo');
foo();
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1-3 arguments, but got 0.
foo(1, 'bar');
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
@@ -1,4 +1,4 @@
tests/cases/compiler/functionCall13.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall13.ts(4,1): error TS2555: Expected at least 1 arguments, but got 0.
tests/cases/compiler/functionCall13.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
@@ -8,7 +8,7 @@ tests/cases/compiler/functionCall13.ts(5,5): error TS2345: Argument of type '1'
foo('foo');
foo();
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2555: Expected at least 1 arguments, but got 0.
foo(1, 'bar');
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
@@ -1,5 +1,5 @@
tests/cases/compiler/functionCall16.ts(2,12): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
tests/cases/compiler/functionCall16.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall16.ts(5,1): error TS2555: Expected at least 1 arguments, but got 0.
tests/cases/compiler/functionCall16.ts(6,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
@@ -12,7 +12,7 @@ tests/cases/compiler/functionCall16.ts(6,5): error TS2345: Argument of type '1'
foo('foo', 'bar');
foo();
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2555: Expected at least 1 arguments, but got 0.
foo(1, 'bar');
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
@@ -1,5 +1,5 @@
tests/cases/compiler/functionCall17.ts(2,12): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
tests/cases/compiler/functionCall17.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall17.ts(4,1): error TS2555: Expected at least 1 arguments, but got 0.
tests/cases/compiler/functionCall17.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
tests/cases/compiler/functionCall17.ts(6,12): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
@@ -12,7 +12,7 @@ tests/cases/compiler/functionCall17.ts(6,12): error TS2345: Argument of type '1'
foo('foo');
foo();
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2555: Expected at least 1 arguments, but got 0.
foo(1, 'bar');
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
@@ -1,6 +1,6 @@
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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall6.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall6.ts(4,1): error TS2554: Expected 1 arguments, but got 2.
tests/cases/compiler/functionCall6.ts(5,1): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/compiler/functionCall6.ts (3 errors) ====
@@ -11,8 +11,8 @@ tests/cases/compiler/functionCall6.ts(5,1): error TS2346: Supplied parameters do
!!! error TS2345: Argument of type '2' is not assignable to parameter of type 'string'.
foo('foo', 'bar');
~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 2.
foo();
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,6 +1,6 @@
tests/cases/compiler/functionCall7.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall7.ts(5,1): 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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall7.ts(7,1): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/compiler/functionCall7.ts (3 errors) ====
@@ -10,11 +10,11 @@ tests/cases/compiler/functionCall7.ts(7,1): error TS2346: Supplied parameters do
foo(myC);
foo(myC, myC);
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 2.
foo(4);
~
!!! error TS2345: Argument of type '4' is not assignable to parameter of type 'c1'.
foo();
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,4 +1,4 @@
tests/cases/compiler/functionCall8.ts(3,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall8.ts(3,1): 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'.
@@ -7,7 +7,7 @@ tests/cases/compiler/functionCall8.ts(4,5): error TS2345: Argument of type '4' i
foo('foo');
foo('foo', 'bar');
~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0-1 arguments, but got 2.
foo(4);
~
!!! error TS2345: Argument of type '4' is not assignable to parameter of type 'string'.
@@ -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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionCall9.ts(5,1): error TS2554: Expected 0-2 arguments, but got 3.
==== tests/cases/compiler/functionCall9.ts (2 errors) ====
@@ -11,5 +11,5 @@ tests/cases/compiler/functionCall9.ts(5,1): error TS2346: Supplied parameters do
!!! error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'.
foo('foo', 1, 'bar');
~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 0-2 arguments, but got 3.
foo();
@@ -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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target.
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(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'.
@@ -36,10 +36,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 TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 2.
foo(1, () => { });
~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 2.
function foo2<T extends (x: string) => string>(x: T): T { return x; }
@@ -1,4 +1,4 @@
tests/cases/compiler/functionOverloads29.ts(4,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionOverloads29.ts(4,9): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/compiler/functionOverloads29.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/compiler/functionOverloads29.ts(4,9): error TS2346: Supplied paramet
function foo(bar:any):any{ return bar }
var x = foo();
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,4 +1,4 @@
tests/cases/compiler/functionOverloads34.ts(4,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionOverloads34.ts(4,9): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/compiler/functionOverloads34.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/compiler/functionOverloads34.ts(4,9): error TS2346: Supplied paramet
function foo(bar:{a:any;}):any{ return bar }
var x = foo();
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,4 +1,4 @@
tests/cases/compiler/functionOverloads37.ts(4,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/functionOverloads37.ts(4,9): error TS2554: Expected 1 arguments, but got 0.
==== tests/cases/compiler/functionOverloads37.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/compiler/functionOverloads37.ts(4,9): error TS2346: Supplied paramet
function foo(bar:{a:any;}[]):any{ return bar }
var x = foo();
~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,33 +1,33 @@
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(2,14): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(2,14): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(3,16): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(4,14): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(8,15): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(9,15): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(4,14): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(8,15): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(9,15): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(12,17): error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(13,15): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,15): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(13,15): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,15): error TS2558: Expected 0 type arguments, but got 1.
==== tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts (8 errors) ====
function foo<T, U>(x:T, y:U, f: (v: T) => U) {
var r1 = f<number>(1);
~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var r2 = f(1);
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
var r3 = f<any>(null);
~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var r4 = f(null);
var r11 = f(x);
var r21 = f<number>(x);
~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var r31 = f<any>(null);
~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var r41 = f(null);
var r12 = f(y);
@@ -35,9 +35,9 @@ tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,15
!!! error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'.
var r22 = f<number>(y);
~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var r32 = f<any>(null);
~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var r42 = f(null);
}
@@ -3,8 +3,8 @@ tests/cases/compiler/genericDefaultsErrors.ts(4,59): error TS2344: Type 'T' does
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/genericDefaultsErrors.ts(5,44): error TS2344: Type 'T' does not satisfy the constraint 'number'.
tests/cases/compiler/genericDefaultsErrors.ts(6,39): error TS2344: Type 'number' does not satisfy the constraint 'T'.
tests/cases/compiler/genericDefaultsErrors.ts(10,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericDefaultsErrors.ts(13,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericDefaultsErrors.ts(10,1): error TS2558: Expected 2-3 type arguments, but got 1.
tests/cases/compiler/genericDefaultsErrors.ts(13,1): error TS2558: Expected 2-3 type arguments, but got 4.
tests/cases/compiler/genericDefaultsErrors.ts(17,13): error TS2345: Argument of type '"a"' is not assignable to parameter of type 'number'.
tests/cases/compiler/genericDefaultsErrors.ts(19,11): error TS2428: All declarations of 'i00' must have identical type parameters.
tests/cases/compiler/genericDefaultsErrors.ts(20,11): error TS2428: All declarations of 'i00' must have identical type parameters.
@@ -44,12 +44,12 @@ tests/cases/compiler/genericDefaultsErrors.ts(38,20): error TS4033: Property 'x'
f11(); // ok
f11<1>(); // error
~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2-3 type arguments, but got 1.
f11<1, 2>(); // ok
f11<1, 2, 3>(); // ok
f11<1, 2, 3, 4>(); // error
~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2-3 type arguments, but got 4.
declare function f12<T, U = T>(a?: U): void;
f12<number>(); // ok
@@ -1,4 +1,4 @@
tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts(7,1): error TS2554: Expected 1-3 arguments, but got 0.
==== tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts (1 errors) ====
@@ -10,7 +10,7 @@ tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts(7,1): error TS23
utils.fold(); // error
~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1-3 arguments, but got 0.
utils.fold(null); // no error
utils.fold(null, null); // no error
utils.fold(null, null, null); // error: Unable to invoke type with no call signatures
@@ -1,6 +1,6 @@
tests/cases/compiler/genericWithOpenTypeParameters1.ts(7,40): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
tests/cases/compiler/genericWithOpenTypeParameters1.ts(8,35): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,35): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/genericWithOpenTypeParameters1.ts(8,35): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,35): error TS2558: Expected 0 type arguments, but got 1.
==== tests/cases/compiler/genericWithOpenTypeParameters1.ts (3 errors) ====
@@ -15,9 +15,9 @@ tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,35): error TS2346: Supp
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
var f2 = <T>(x: B<T>) => { return x.foo<T>(1); } // error
~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var f3 = <T>(x: B<T>) => { return x.foo<number>(1); } // error
~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
var f4 = (x: B<number>) => { return x.foo(1); } // no error
@@ -1,5 +1,5 @@
tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts(8,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts(9,1): error TS2346: Supplied parameters do not match any signature of call target.
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 (2 errors) ====
@@ -12,9 +12,9 @@ tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts(9,1): er
f(g<A, B>(7));
f(g < A, B > 7); // Should error
~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 2.
f(g < A, B > +(7)); // Should error
~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 2.
@@ -1,7 +1,7 @@
tests/cases/compiler/grammarAmbiguities1.ts(8,1): error TS2346: Supplied parameters do not match any signature of call target.
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 TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/grammarAmbiguities1.ts(9,1): 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'.
@@ -16,14 +16,14 @@ tests/cases/compiler/grammarAmbiguities1.ts(9,10): error TS2365: Operator '>' ca
f(g<A, B>(7));
f(g < A, B > 7);
~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! 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 TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2554: Expected 1 arguments, but got 2.
~~~~~
!!! error TS2365: Operator '<' cannot be applied to types '<T, U>(x: any) => any' and 'typeof A'.
~~~~~~~~
@@ -1,5 +1,5 @@
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(8,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(16,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(8,9): error TS2558: Expected 1 type arguments, but got 2.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(16,9): error TS2558: Expected 2 type arguments, but got 1.
==== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts (2 errors) ====
@@ -12,7 +12,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGeneri
var c = new C<number, number>();
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 1 type arguments, but got 2.
class D<T, U> {
x: T
@@ -22,4 +22,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGeneri
// BUG 794238
var d = new D<number>();
~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 2 type arguments, but got 1.
@@ -1,8 +1,8 @@
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(8,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(8,9): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,9): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,9): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,10): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,10): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(18,10): error TS2347: Untyped function calls may not accept type arguments.
@@ -16,21 +16,21 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGen
var c = new C<number>();
~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2558: Expected 0 type arguments, but got 1.
function Foo(): void { }
var r = new Foo<number>();
~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
~~~~~~~~~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
~~~~~~~~~~~~~~~~~
!!! error TS2558: Expected 0 type arguments, but got 1.
var f: { (): void };
var r2 = new f<number>();
~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
~~~~~~~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
~~~~~~~~~~~~~~~
!!! error TS2558: Expected 0 type arguments, but got 1.
var a: any;
// BUG 790977
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts(15,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts(15,1): error TS2556: Expected 1 arguments, but got a minimum of 0.
==== tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts (1 errors) ====
@@ -18,4 +18,4 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts(15,1): error TS2346:
foo(...new SymbolIterator);
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2556: Expected 1 arguments, but got a minimum of 0.
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts(15,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts(15,1): error TS2556: Expected 1 arguments, but got a minimum of 0.
==== tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts (1 errors) ====
@@ -18,4 +18,4 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall10.ts(15,1): error TS2346
foo(...new SymbolIterator);
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2556: Expected 1 arguments, but got a minimum of 0.
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts(15,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts(15,1): error TS2556: Expected 1 arguments, but got a minimum of 0.
==== tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts (1 errors) ====
@@ -18,4 +18,4 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts(15,1): error TS2346:
foo(...new SymbolIterator);
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2556: Expected 1 arguments, but got a minimum of 0.
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts(15,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts(15,1): error TS2557: Expected at least 1 arguments, but got a minimum of 0.
==== tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts (1 errors) ====
@@ -18,4 +18,4 @@ tests/cases/conformance/es6/spread/iteratorSpreadInCall4.ts(15,1): error TS2346:
foo(...new SymbolIterator);
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
!!! error TS2557: Expected at least 1 arguments, but got a minimum of 0.

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