Merge remote-tracking branch 'origin/master' into numericPropertyAccess

This commit is contained in:
Daniel Rosenwasser committed 2018-12-11 16:52:23 -08:00
commit 2999a1eb47
117 files changed
+1888 -405

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ Please fill in the *entire* template below.
-->
<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:** 3.2.0-dev.201xxxxx
**TypeScript Version:** 3.3.0-dev.201xxxxx
<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
+2 -1
View File
@@ -117,7 +117,8 @@ const generatedLCGFile = "built/local/enu/diagnosticMessages.generated.json.lcg"
* 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
* generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
*/
const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-CN", "zh-TW"]
const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"]
.map(f => f.toLowerCase())
.map(f => `built/local/${f}/diagnosticMessages.generated.json`)
.concat(generatedLCGFile);
-15
View File
@@ -24,8 +24,6 @@ else if (process.env.PATH !== undefined) {
const host = process.env.TYPESCRIPT_HOST || process.env.host || "node";
const locales = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-CN", "zh-TW"];
const defaultTestTimeout = 40000;
let useDebugMode = true;
@@ -709,19 +707,6 @@ const Travis = {
}
};
function buildLocalizedTargets() {
/**
* The localization target produces the two following transformations:
* 1. 'src\loc\lcl\<locale>\diagnosticMessages.generated.json.lcl' => 'built\local\<locale>\diagnosticMessages.generated.json'
* convert localized resources into a .json file the compiler can understand
* 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
* generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
*/
const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"]
.map(f => path.join(Paths.builtLocal,f))
.concat(path.dirname(Paths.generatedLCGFile));
}
function toNs(diff) {
return diff[0] * 1e9 + diff[1];
}
@@ -36,7 +36,7 @@ function main(): void {
console.error("Unexpected XML file structure. Expected to find result.LCX.$.TgtCul.");
process.exit(1);
}
const outputDirectoryName = getPreferedLocaleName(result.LCX.$.TgtCul);
const outputDirectoryName = getPreferedLocaleName(result.LCX.$.TgtCul).toLowerCase();
if (!outputDirectoryName) {
console.error(`Invalid output locale name for '${result.LCX.$.TgtCul}'.`);
process.exit(1);
+68 -34
View File
@@ -1419,12 +1419,18 @@ namespace ts {
}
}
break;
case SyntaxKind.ArrowFunction:
// when targeting ES6 or higher there is no 'arguments' in an arrow function
// for lower compile targets the resolved symbol is used to emit an error
if (compilerOptions.target! >= ScriptTarget.ES2015) {
break;
}
// falls through
case SyntaxKind.MethodDeclaration:
case SyntaxKind.Constructor:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.ArrowFunction:
if (meaning & SymbolFlags.Variable && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -4709,6 +4715,10 @@ namespace ts {
return prop ? getTypeOfSymbol(prop) : undefined;
}
function getTypeOfPropertyOrIndexSignature(type: Type, name: __String): Type {
return getTypeOfPropertyOfType(type, name) || isNumericLiteralName(name) && getIndexTypeOfType(type, IndexKind.Number) || getIndexTypeOfType(type, IndexKind.String) || unknownType;
}
function isTypeAny(type: Type | undefined) {
return type && (type.flags & TypeFlags.Any) !== 0;
}
@@ -12168,10 +12178,6 @@ namespace ts {
return result;
}
function getConstraintForRelation(type: Type) {
return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type);
}
function structuredTypeRelatedTo(source: Type, target: Type, reportErrors: boolean, isIntersectionConstituent: boolean): Ternary {
const flags = source.flags & target.flags;
if (relation === identityRelation && !(flags & TypeFlags.Object)) {
@@ -12304,24 +12310,26 @@ namespace ts {
return result;
}
}
const constraint = getConstraintForRelation(<TypeParameter>source);
if (!constraint || (source.flags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.AnyOrUnknown)) {
// A type variable with no constraint is not related to the non-primitive object type.
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive))) {
if (relation !== definitelyAssignableRelation) {
const constraint = getConstraintOfType(<TypeParameter>source);
if (!constraint || (source.flags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any)) {
// A type variable with no constraint is not related to the non-primitive object type.
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive))) {
errorInfo = saveErrorInfo;
return result;
}
}
// hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
else if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, isIntersectionConstituent)) {
errorInfo = saveErrorInfo;
return result;
}
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, /*headMessage*/ undefined, isIntersectionConstituent)) {
errorInfo = saveErrorInfo;
return result;
}
}
// hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
else if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, isIntersectionConstituent)) {
errorInfo = saveErrorInfo;
return result;
}
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, /*headMessage*/ undefined, isIntersectionConstituent)) {
errorInfo = saveErrorInfo;
return result;
}
}
else if (source.flags & TypeFlags.Index) {
if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) {
@@ -12473,10 +12481,10 @@ namespace ts {
return propertiesIdenticalTo(source, target);
}
const requireOptionalProperties = relation === subtypeRelation && !isObjectLiteralType(source) && !isEmptyArrayLiteralType(source) && !isTupleType(source);
const unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties);
const unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false);
if (unmatchedProperty) {
if (reportErrors) {
const props = arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties));
const props = arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false));
if (!headMessage || (headMessage.code !== Diagnostics.Class_0_incorrectly_implements_interface_1.code &&
headMessage.code !== Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)) {
suppressNextError = true; // Retain top-level error for interface implementing issues, otherwise omit it
@@ -13900,7 +13908,7 @@ namespace ts {
return getTypeFromInference(inference);
}
function* getUnmatchedProperties(source: Type, target: Type, requireOptionalProperties: boolean) {
function* getUnmatchedProperties(source: Type, target: Type, requireOptionalProperties: boolean, matchDiscriminantProperties: boolean) {
const properties = target.flags & TypeFlags.Intersection ? getPropertiesOfUnionOrIntersectionType(<IntersectionType>target) : getPropertiesOfObjectType(target);
for (const targetProp of properties) {
if (requireOptionalProperties || !(targetProp.flags & SymbolFlags.Optional)) {
@@ -13908,12 +13916,21 @@ namespace ts {
if (!sourceProp) {
yield targetProp;
}
else if (matchDiscriminantProperties) {
const targetType = getTypeOfSymbol(targetProp);
if (targetType.flags & TypeFlags.Unit) {
const sourceType = getTypeOfSymbol(sourceProp);
if (!(sourceType.flags & TypeFlags.Any || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) {
yield targetProp;
}
}
}
}
}
}
function getUnmatchedProperty(source: Type, target: Type, requireOptionalProperties: boolean): Symbol | undefined {
return getUnmatchedProperties(source, target, requireOptionalProperties).next().value;
function getUnmatchedProperty(source: Type, target: Type, requireOptionalProperties: boolean, matchDiscriminantProperties: boolean): Symbol | undefined {
return getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties).next().value;
}
function tupleTypesDefinitelyUnrelated(source: TupleTypeReference, target: TupleTypeReference) {
@@ -13925,7 +13942,8 @@ namespace ts {
// Two tuple types with incompatible arities are definitely unrelated.
// Two object types that each have a property that is unmatched in the other are definitely unrelated.
return isTupleType(source) && isTupleType(target) && tupleTypesDefinitelyUnrelated(source, target) ||
!!getUnmatchedProperty(source, target, /*requireOptionalProperties*/ false) && !!getUnmatchedProperty(target, source, /*requireOptionalProperties*/ false);
!!getUnmatchedProperty(source, target, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ true) &&
!!getUnmatchedProperty(target, source, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ true);
}
function getTypeFromInference(inference: InferenceInfo) {
@@ -15643,7 +15661,7 @@ namespace ts {
}
const propType = getTypeOfPropertyOfType(type, propName);
const narrowedPropType = propType && narrowType(propType);
return propType === narrowedPropType ? type : filterType(type, t => isTypeComparableTo(getTypeOfPropertyOfType(t, propName)!, narrowedPropType!));
return propType === narrowedPropType ? type : filterType(type, t => isTypeComparableTo(getTypeOfPropertyOrIndexSignature(t, propName), narrowedPropType!));
}
function narrowTypeByTruthiness(type: Type, expr: Expression, assumeTrue: boolean): Type {
@@ -19872,14 +19890,31 @@ namespace ts {
}
function getTypeArgumentArityError(node: Node, signatures: ReadonlyArray<Signature>, typeArguments: NodeArray<TypeNode>) {
let min = Infinity;
let max = -Infinity;
for (const sig of signatures) {
min = Math.min(min, getMinTypeArgumentCount(sig.typeParameters));
max = Math.max(max, length(sig.typeParameters));
const argCount = typeArguments.length;
// No overloads exist
if (signatures.length === 1) {
const sig = signatures[0];
const min = getMinTypeArgumentCount(sig.typeParameters);
const max = length(sig.typeParameters);
return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min < max ? min + "-" + max : min , argCount);
}
const paramCount = min === max ? min : min + "-" + max;
return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length);
// Overloads exist
let belowArgCount = -Infinity;
let aboveArgCount = Infinity;
for (const sig of signatures) {
const min = getMinTypeArgumentCount(sig.typeParameters);
const max = length(sig.typeParameters);
if (min > argCount) {
aboveArgCount = Math.min(aboveArgCount, min);
}
else if (max < argCount) {
belowArgCount = Math.max(belowArgCount, max);
}
}
if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) {
return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount);
}
return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
}
function resolveCall(node: CallLikeExpression, signatures: ReadonlyArray<Signature>, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean, fallbackError?: DiagnosticMessage): Signature {
@@ -23633,7 +23668,6 @@ namespace ts {
break;
}
}
checkGrammarForDisallowedTrailingComma(node.elementTypes);
forEach(node.elementTypes, checkSourceElement);
}
+5 -1
View File
@@ -2165,6 +2165,10 @@ namespace ts {
}
export function fill<T>(length: number, cb: (index: number) => T): T[] {
return new Array(length).fill(0).map((_, i) => cb(i));
const result = Array<T>(length);
for (let i = 0; i < length; i++) {
result[i] = cb(i);
}
return result;
}
}
+8
View File
@@ -1011,6 +1011,10 @@
"category": "Message",
"code": 1350
},
"An identifier or keyword cannot immediately follow a numeric literal.": {
"category": "Error",
"code": 1351
},
"Duplicate identifier '{0}'.": {
"category": "Error",
@@ -2529,6 +2533,10 @@
"category": "Error",
"code": 2742
},
"No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments.": {
"category": "Error",
"code": 2743
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
+10 -10
View File
@@ -40,18 +40,18 @@ namespace ts {
type Recurser = <T>(obj: unknown, name: string, cbOk: () => T, cbFail: (isCircularReference: boolean, keyStack: ReadonlyArray<string>) => T) => T;
function getRecurser(): Recurser {
const seen = new Set<unknown>();
const seen: unknown[] = [];
const nameStack: string[] = [];
return (obj, name, cbOk, cbFail) => {
if (seen.has(obj) || nameStack.length > 4) {
return cbFail(seen.has(obj), nameStack);
if (seen.indexOf(obj) !== -1 || nameStack.length > 4) {
return cbFail(seen.indexOf(obj) !== -1, nameStack);
}
seen.add(obj);
seen.push(obj);
nameStack.push(name);
const res = cbOk();
nameStack.pop();
seen.delete(obj);
seen.pop();
return res;
};
}
@@ -104,8 +104,8 @@ namespace ts {
key === "constructor" ? undefined : getValueInfo(key, value, recurser));
}
const ignoredProperties: ReadonlySet<string> = new Set(["arguments", "caller", "constructor", "eval", "super_"]);
const reservedFunctionProperties: ReadonlySet<string> = new Set(Object.getOwnPropertyNames(noop));
const ignoredProperties: ReadonlyArray<string> = ["arguments", "caller", "constructor", "eval", "super_"];
const reservedFunctionProperties: ReadonlyArray<string> = Object.getOwnPropertyNames(noop);
interface ObjectEntry { readonly key: string; readonly value: unknown; }
function getEntriesOfObject(obj: object): ReadonlyArray<ObjectEntry> {
const seen = createMap<true>();
@@ -114,8 +114,8 @@ namespace ts {
while (!isNullOrUndefined(chain) && chain !== Object.prototype && chain !== Function.prototype) {
for (const key of Object.getOwnPropertyNames(chain)) {
if (!isJsPrivate(key) &&
!ignoredProperties.has(key) &&
(typeof obj !== "function" || !reservedFunctionProperties.has(key)) &&
ignoredProperties.indexOf(key) === -1 &&
(typeof obj !== "function" || reservedFunctionProperties.indexOf(key) === -1) &&
// Don't add property from a higher prototype if it already exists in a lower one
addToSeen(seen, key)) {
const value = safeGetPropertyOfObject(chain, key);
@@ -148,7 +148,7 @@ namespace ts {
}
export function isJsPrivate(name: string): boolean {
return name.startsWith("_");
return startsWith(name, "_");
}
function tryRequire(fileNameToRequire: string): unknown {
+1 -1
View File
@@ -203,7 +203,7 @@ namespace ts.moduleSpecifiers {
return; // Don't want to a package to globally import from itself
}
const target = targets.find(t => compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === Comparison.EqualTo);
const target = find(targets, t => compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === Comparison.EqualTo);
if (target === undefined) return;
const relative = getRelativePathFromDirectory(resolved, target, getCanonicalFileName);
+14
View File
@@ -974,7 +974,9 @@ namespace ts {
else {
result = text.substring(start, end); // No need to use all the fragments; no _ removal needed
}
if (decimalFragment !== undefined || tokenFlags & TokenFlags.Scientific) {
checkForIdentifierStartAfterNumericLiteral();
return {
type: SyntaxKind.NumericLiteral,
value: "" + +result // if value is not an integer, it can be safely coerced to a number
@@ -983,10 +985,22 @@ namespace ts {
else {
tokenValue = result;
const type = checkBigIntSuffix(); // if value is an integer, check whether it is a bigint
checkForIdentifierStartAfterNumericLiteral();
return { type, value: tokenValue };
}
}
function checkForIdentifierStartAfterNumericLiteral() {
if (!isIdentifierStart(text.charCodeAt(pos), languageVersion)) {
return;
}
const identifierStart = pos;
const { length } = scanIdentifierParts();
error(Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length);
pos = identifierStart;
}
function scanOctalDigits(): number {
const start = pos;
while (isOctalDigit(text.charCodeAt(pos))) {
+2
View File
@@ -4450,6 +4450,8 @@ namespace FourSlashInterface {
interfaceEntry("ObjectConstructor"),
constEntry("Function"),
interfaceEntry("FunctionConstructor"),
typeEntry("ThisParameterType"),
typeEntry("OmitThisParameter"),
interfaceEntry("CallableFunction"),
interfaceEntry("NewableFunction"),
interfaceEntry("IArguments"),
+12 -2
View File
@@ -295,6 +295,16 @@ interface FunctionConstructor {
declare const Function: FunctionConstructor;
/**
* Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.
*/
type ThisParameterType<T> = T extends (this: unknown, ...args: any[]) => any ? unknown : T extends (this: infer U, ...args: any[]) => any ? U : unknown;
/**
* Removes the 'this' parameter from a function type.
*/
type OmitThisParameter<T> = unknown extends ThisParameterType<T> ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T;
interface CallableFunction extends Function {
/**
* Calls the function with the specified object as the this value and the elements of specified array as the arguments.
@@ -317,7 +327,7 @@ interface CallableFunction extends Function {
* @param thisArg The object to be used as the this object.
* @param args Arguments to bind to the parameters of the function.
*/
bind<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R;
bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
bind<T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;
bind<T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;
bind<T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;
@@ -347,7 +357,7 @@ interface NewableFunction extends Function {
* @param thisArg The object to be used as the this object.
* @param args Arguments to bind to the parameters of the function.
*/
bind<A extends any[], R>(this: new (...args: A) => R, thisArg: any): new (...args: A) => R;
bind<T>(this: T, thisArg: any): T;
bind<A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;
bind<A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;
bind<A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;
+6 -2
View File
@@ -1428,6 +1428,10 @@ namespace ts.FindAllReferences.Core {
return [{ definition: { type: DefinitionKind.Symbol, symbol: searchSpaceNode.symbol }, references }];
}
function isParameterName(node: Node) {
return node.kind === SyntaxKind.Identifier && node.parent.kind === SyntaxKind.Parameter && (<ParameterDeclaration>node.parent).name === node;
}
function getReferencesForThisKeyword(thisOrSuperKeyword: Node, sourceFiles: ReadonlyArray<SourceFile>, cancellationToken: CancellationToken): SymbolAndEntries[] | undefined {
let searchSpaceNode = getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false);
@@ -1450,7 +1454,7 @@ namespace ts.FindAllReferences.Core {
searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class
break;
case SyntaxKind.SourceFile:
if (isExternalModule(<SourceFile>searchSpaceNode)) {
if (isExternalModule(<SourceFile>searchSpaceNode) || isParameterName(thisOrSuperKeyword)) {
return undefined;
}
// falls through
@@ -1483,7 +1487,7 @@ namespace ts.FindAllReferences.Core {
// and has the appropriate static modifier from the original container.
return container.parent && searchSpaceNode.symbol === container.parent.symbol && (getModifierFlags(container) & ModifierFlags.Static) === staticFlag;
case SyntaxKind.SourceFile:
return container.kind === SyntaxKind.SourceFile && !isExternalModule(<SourceFile>container);
return container.kind === SyntaxKind.SourceFile && !isExternalModule(<SourceFile>container) && !isParameterName(node);
}
});
}).map(n => nodeEntry(n));
+1 -1
View File
@@ -45,7 +45,7 @@ namespace ts.Rename {
const moduleSourceFile = find(moduleSymbol.declarations, isSourceFile);
if (!moduleSourceFile) return undefined;
const withoutIndex = node.text.endsWith("/index") || node.text.endsWith("/index.js") ? undefined : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index");
const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? undefined : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index");
const name = withoutIndex === undefined ? moduleSourceFile.fileName : withoutIndex;
const kind = withoutIndex === undefined ? ScriptElementKind.moduleElement : ScriptElementKind.directory;
const indexAfterLastSlash = node.text.lastIndexOf("/") + 1;
+5
View File
@@ -133,6 +133,11 @@ namespace ts {
if (configFileName) {
const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, sys, reportDiagnostic)!; // TODO: GH#18217
if (commandLineOptions.showConfig) {
if (configParseResult.errors.length !== 0) {
updateReportDiagnostic(configParseResult.options);
configParseResult.errors.forEach(reportDiagnostic);
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
}
// tslint:disable-next-line:no-null-keyword
sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine);
return sys.exit(ExitStatus.Success);
+1 -1
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"pretty": true,
"lib": ["es2015"],
"lib": ["es2015.iterable", "es5"],
"target": "es5",
"rootDir": ".",
@@ -1,7 +0,0 @@
tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType5.ts(1,15): error TS1009: Trailing comma not allowed.
==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType5.ts (1 errors) ====
var v: [number,]
~
!!! error TS1009: Trailing comma not allowed.
@@ -0,0 +1,7 @@
tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts(1,16): error TS1110: Type expected.
==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts (1 errors) ====
var v: [number,,]
~
!!! error TS1110: Type expected.
+5
View File
@@ -0,0 +1,5 @@
//// [TupleType6.ts]
var v: [number,,]
//// [TupleType6.js]
var v;
@@ -0,0 +1,4 @@
=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts ===
var v: [number,,]
>v : Symbol(v, Decl(TupleType6.ts, 0, 3))
@@ -0,0 +1,4 @@
=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts ===
var v: [number,,]
>v : [number, any]
+12 -6
View File
@@ -1,15 +1,21 @@
tests/cases/compiler/arguments.ts(6,25): error TS2304: Cannot find name 'arguments'.
tests/cases/compiler/arguments.ts(7,23): error TS2304: Cannot find name 'arguments'.
tests/cases/compiler/arguments.ts(8,19): error TS2304: Cannot find name 'arguments'.
tests/cases/compiler/arguments.ts(9,23): error TS2304: Cannot find name 'arguments'.
tests/cases/compiler/arguments.ts(10,34): error TS2304: Cannot find name 'arguments'.
tests/cases/compiler/arguments.ts(6,8): error TS2304: Cannot find name 'arguments'.
tests/cases/compiler/arguments.ts(9,25): error TS2304: Cannot find name 'arguments'.
tests/cases/compiler/arguments.ts(10,23): error TS2304: Cannot find name 'arguments'.
tests/cases/compiler/arguments.ts(11,19): error TS2304: Cannot find name 'arguments'.
tests/cases/compiler/arguments.ts(12,23): error TS2304: Cannot find name 'arguments'.
tests/cases/compiler/arguments.ts(13,34): error TS2304: Cannot find name 'arguments'.
==== tests/cases/compiler/arguments.ts (5 errors) ====
==== tests/cases/compiler/arguments.ts (6 errors) ====
function f() {
var x=arguments[12];
(() => arguments)();
}
(() => arguments)();
~~~~~~~~~
!!! error TS2304: Cannot find name 'arguments'.
interface I {
method(args: typeof arguments): void;
~~~~~~~~~
+5
View File
@@ -1,8 +1,11 @@
//// [arguments.ts]
function f() {
var x=arguments[12];
(() => arguments)();
}
(() => arguments)();
interface I {
method(args: typeof arguments): void;
fn: (args: typeof arguments) => void;
@@ -14,4 +17,6 @@ interface I {
//// [arguments.js]
function f() {
var x = arguments[12];
(() => arguments)();
}
(() => arguments)();
+14 -9
View File
@@ -4,27 +4,32 @@ function f() {
var x=arguments[12];
>x : Symbol(x, Decl(arguments.ts, 1, 7))
>arguments : Symbol(arguments)
(() => arguments)();
>arguments : Symbol(arguments)
}
(() => arguments)();
interface I {
>I : Symbol(I, Decl(arguments.ts, 2, 1))
>I : Symbol(I, Decl(arguments.ts, 5, 20))
method(args: typeof arguments): void;
>method : Symbol(I.method, Decl(arguments.ts, 4, 13))
>args : Symbol(args, Decl(arguments.ts, 5, 11))
>method : Symbol(I.method, Decl(arguments.ts, 7, 13))
>args : Symbol(args, Decl(arguments.ts, 8, 11))
fn: (args: typeof arguments) => void;
>fn : Symbol(I.fn, Decl(arguments.ts, 5, 41))
>args : Symbol(args, Decl(arguments.ts, 6, 9))
>fn : Symbol(I.fn, Decl(arguments.ts, 8, 41))
>args : Symbol(args, Decl(arguments.ts, 9, 9))
(args: typeof arguments): void;
>args : Symbol(args, Decl(arguments.ts, 7, 5))
>args : Symbol(args, Decl(arguments.ts, 10, 5))
new (args: typeof arguments): void;
>args : Symbol(args, Decl(arguments.ts, 8, 9))
>args : Symbol(args, Decl(arguments.ts, 11, 9))
construct: new (args: typeof arguments) => void;
>construct : Symbol(I.construct, Decl(arguments.ts, 8, 39))
>args : Symbol(args, Decl(arguments.ts, 9, 20))
>construct : Symbol(I.construct, Decl(arguments.ts, 11, 39))
>args : Symbol(args, Decl(arguments.ts, 12, 20))
}
+12
View File
@@ -7,8 +7,20 @@ function f() {
>arguments[12] : any
>arguments : IArguments
>12 : 12
(() => arguments)();
>(() => arguments)() : IArguments
>(() => arguments) : () => IArguments
>() => arguments : () => IArguments
>arguments : IArguments
}
(() => arguments)();
>(() => arguments)() : any
>(() => arguments) : () => any
>() => arguments : () => any
>arguments : any
interface I {
method(args: typeof arguments): void;
>method : (args: any) => void
@@ -41,7 +41,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(
a1(...array2); // Error parameter type is (number|string)[]
~~~~~~
!!! error TS2552: Cannot find name 'array2'. Did you mean 'Array'?
!!! related TS2728 /.ts/lib.es5.d.ts:1358:15: 'Array' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:1368:15: 'Array' is declared here.
a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]]
~~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type '[[any]]'.
@@ -0,0 +1,27 @@
//// [discriminatedUnionInference.ts]
// Repro from #28862
type Foo<A> = { type: "foo", (): A[] };
type Bar<A> = { type: "bar", (): A };
type FooBar<A> = Foo<A> | Bar<A>;
type InferA<T> = T extends FooBar<infer A> ? A : never;
type FooA = InferA<Foo<number>>; // number
// Repro from #28862
type Item<T> = { kind: 'a', data: T } | { kind: 'b', data: T[] };
declare function foo<T>(item: Item<T>): T;
let x1 = foo({ kind: 'a', data: 42 }); // number
let x2 = foo({ kind: 'b', data: [1, 2] }); // number
//// [discriminatedUnionInference.js]
"use strict";
// Repro from #28862
var x1 = foo({ kind: 'a', data: 42 }); // number
var x2 = foo({ kind: 'b', data: [1, 2] }); // number
@@ -0,0 +1,68 @@
=== tests/cases/conformance/types/typeRelationships/typeInference/discriminatedUnionInference.ts ===
// Repro from #28862
type Foo<A> = { type: "foo", (): A[] };
>Foo : Symbol(Foo, Decl(discriminatedUnionInference.ts, 0, 0))
>A : Symbol(A, Decl(discriminatedUnionInference.ts, 2, 9))
>type : Symbol(type, Decl(discriminatedUnionInference.ts, 2, 15))
>A : Symbol(A, Decl(discriminatedUnionInference.ts, 2, 9))
type Bar<A> = { type: "bar", (): A };
>Bar : Symbol(Bar, Decl(discriminatedUnionInference.ts, 2, 39))
>A : Symbol(A, Decl(discriminatedUnionInference.ts, 3, 9))
>type : Symbol(type, Decl(discriminatedUnionInference.ts, 3, 15))
>A : Symbol(A, Decl(discriminatedUnionInference.ts, 3, 9))
type FooBar<A> = Foo<A> | Bar<A>;
>FooBar : Symbol(FooBar, Decl(discriminatedUnionInference.ts, 3, 37))
>A : Symbol(A, Decl(discriminatedUnionInference.ts, 5, 12))
>Foo : Symbol(Foo, Decl(discriminatedUnionInference.ts, 0, 0))
>A : Symbol(A, Decl(discriminatedUnionInference.ts, 5, 12))
>Bar : Symbol(Bar, Decl(discriminatedUnionInference.ts, 2, 39))
>A : Symbol(A, Decl(discriminatedUnionInference.ts, 5, 12))
type InferA<T> = T extends FooBar<infer A> ? A : never;
>InferA : Symbol(InferA, Decl(discriminatedUnionInference.ts, 5, 33))
>T : Symbol(T, Decl(discriminatedUnionInference.ts, 7, 12))
>T : Symbol(T, Decl(discriminatedUnionInference.ts, 7, 12))
>FooBar : Symbol(FooBar, Decl(discriminatedUnionInference.ts, 3, 37))
>A : Symbol(A, Decl(discriminatedUnionInference.ts, 7, 39))
>A : Symbol(A, Decl(discriminatedUnionInference.ts, 7, 39))
type FooA = InferA<Foo<number>>; // number
>FooA : Symbol(FooA, Decl(discriminatedUnionInference.ts, 7, 55))
>InferA : Symbol(InferA, Decl(discriminatedUnionInference.ts, 5, 33))
>Foo : Symbol(Foo, Decl(discriminatedUnionInference.ts, 0, 0))
// Repro from #28862
type Item<T> = { kind: 'a', data: T } | { kind: 'b', data: T[] };
>Item : Symbol(Item, Decl(discriminatedUnionInference.ts, 9, 32))
>T : Symbol(T, Decl(discriminatedUnionInference.ts, 13, 10))
>kind : Symbol(kind, Decl(discriminatedUnionInference.ts, 13, 16))
>data : Symbol(data, Decl(discriminatedUnionInference.ts, 13, 27))
>T : Symbol(T, Decl(discriminatedUnionInference.ts, 13, 10))
>kind : Symbol(kind, Decl(discriminatedUnionInference.ts, 13, 41))
>data : Symbol(data, Decl(discriminatedUnionInference.ts, 13, 52))
>T : Symbol(T, Decl(discriminatedUnionInference.ts, 13, 10))
declare function foo<T>(item: Item<T>): T;
>foo : Symbol(foo, Decl(discriminatedUnionInference.ts, 13, 65))
>T : Symbol(T, Decl(discriminatedUnionInference.ts, 15, 21))
>item : Symbol(item, Decl(discriminatedUnionInference.ts, 15, 24))
>Item : Symbol(Item, Decl(discriminatedUnionInference.ts, 9, 32))
>T : Symbol(T, Decl(discriminatedUnionInference.ts, 15, 21))
>T : Symbol(T, Decl(discriminatedUnionInference.ts, 15, 21))
let x1 = foo({ kind: 'a', data: 42 }); // number
>x1 : Symbol(x1, Decl(discriminatedUnionInference.ts, 17, 3))
>foo : Symbol(foo, Decl(discriminatedUnionInference.ts, 13, 65))
>kind : Symbol(kind, Decl(discriminatedUnionInference.ts, 17, 14))
>data : Symbol(data, Decl(discriminatedUnionInference.ts, 17, 25))
let x2 = foo({ kind: 'b', data: [1, 2] }); // number
>x2 : Symbol(x2, Decl(discriminatedUnionInference.ts, 18, 3))
>foo : Symbol(foo, Decl(discriminatedUnionInference.ts, 13, 65))
>kind : Symbol(kind, Decl(discriminatedUnionInference.ts, 18, 14))
>data : Symbol(data, Decl(discriminatedUnionInference.ts, 18, 25))
@@ -0,0 +1,55 @@
=== tests/cases/conformance/types/typeRelationships/typeInference/discriminatedUnionInference.ts ===
// Repro from #28862
type Foo<A> = { type: "foo", (): A[] };
>Foo : Foo<A>
>type : "foo"
type Bar<A> = { type: "bar", (): A };
>Bar : Bar<A>
>type : "bar"
type FooBar<A> = Foo<A> | Bar<A>;
>FooBar : FooBar<A>
type InferA<T> = T extends FooBar<infer A> ? A : never;
>InferA : InferA<T>
type FooA = InferA<Foo<number>>; // number
>FooA : number
// Repro from #28862
type Item<T> = { kind: 'a', data: T } | { kind: 'b', data: T[] };
>Item : Item<T>
>kind : "a"
>data : T
>kind : "b"
>data : T[]
declare function foo<T>(item: Item<T>): T;
>foo : <T>(item: Item<T>) => T
>item : Item<T>
let x1 = foo({ kind: 'a', data: 42 }); // number
>x1 : number
>foo({ kind: 'a', data: 42 }) : number
>foo : <T>(item: Item<T>) => T
>{ kind: 'a', data: 42 } : { kind: "a"; data: number; }
>kind : "a"
>'a' : "a"
>data : number
>42 : 42
let x2 = foo({ kind: 'b', data: [1, 2] }); // number
>x2 : number
>foo({ kind: 'b', data: [1, 2] }) : number
>foo : <T>(item: Item<T>) => T
>{ kind: 'b', data: [1, 2] } : { kind: "b"; data: number[]; }
>kind : "b"
>'b' : "b"
>data : number[]
>[1, 2] : number[]
>1 : 1
>2 : 2
@@ -83,4 +83,26 @@ tests/cases/conformance/types/union/discriminatedUnionTypes2.ts(32,11): error TS
const data: null = carrier.data
}
}
// Repro from #28935
type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string };
function f30(foo: Foo) {
if (foo.tag) {
foo;
}
else {
foo;
}
}
function f31(foo: Foo) {
if (foo.tag === true) {
foo;
}
else {
foo;
}
}
@@ -71,6 +71,28 @@ function f20<Data>(carrier: DataCarrier<Data>) {
const data: null = carrier.data
}
}
// Repro from #28935
type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string };
function f30(foo: Foo) {
if (foo.tag) {
foo;
}
else {
foo;
}
}
function f31(foo: Foo) {
if (foo.tag === true) {
foo;
}
else {
foo;
}
}
//// [discriminatedUnionTypes2.js]
@@ -126,3 +148,19 @@ function f20(carrier) {
var data = carrier.data;
}
}
function f30(foo) {
if (foo.tag) {
foo;
}
else {
foo;
}
}
function f31(foo) {
if (foo.tag === true) {
foo;
}
else {
foo;
}
}
@@ -225,3 +225,51 @@ function f20<Data>(carrier: DataCarrier<Data>) {
}
}
// Repro from #28935
type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string };
>Foo : Symbol(Foo, Decl(discriminatedUnionTypes2.ts, 71, 1))
>tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 12))
>x : Symbol(x, Decl(discriminatedUnionTypes2.ts, 75, 23))
>tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 39))
>y : Symbol(y, Decl(discriminatedUnionTypes2.ts, 75, 51))
>x : Symbol(x, Decl(discriminatedUnionTypes2.ts, 75, 69))
function f30(foo: Foo) {
>f30 : Symbol(f30, Decl(discriminatedUnionTypes2.ts, 75, 90))
>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 77, 13))
>Foo : Symbol(Foo, Decl(discriminatedUnionTypes2.ts, 71, 1))
if (foo.tag) {
>foo.tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 12), Decl(discriminatedUnionTypes2.ts, 75, 39))
>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 77, 13))
>tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 12), Decl(discriminatedUnionTypes2.ts, 75, 39))
foo;
>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 77, 13))
}
else {
foo;
>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 77, 13))
}
}
function f31(foo: Foo) {
>f31 : Symbol(f31, Decl(discriminatedUnionTypes2.ts, 84, 1))
>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 86, 13))
>Foo : Symbol(Foo, Decl(discriminatedUnionTypes2.ts, 71, 1))
if (foo.tag === true) {
>foo.tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 12), Decl(discriminatedUnionTypes2.ts, 75, 39))
>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 86, 13))
>tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 12), Decl(discriminatedUnionTypes2.ts, 75, 39))
foo;
>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 86, 13))
}
else {
foo;
>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 86, 13))
}
}
@@ -239,3 +239,53 @@ function f20<Data>(carrier: DataCarrier<Data>) {
}
}
// Repro from #28935
type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string };
>Foo : Foo
>tag : true
>true : true
>x : number
>tag : false
>false : false
>y : number
>x : string
function f30(foo: Foo) {
>f30 : (foo: Foo) => void
>foo : Foo
if (foo.tag) {
>foo.tag : string | boolean
>foo : Foo
>tag : string | boolean
foo;
>foo : { tag: true; x: number; } | { [x: string]: string; }
}
else {
foo;
>foo : { tag: false; y: number; } | { [x: string]: string; }
}
}
function f31(foo: Foo) {
>f31 : (foo: Foo) => void
>foo : Foo
if (foo.tag === true) {
>foo.tag === true : boolean
>foo.tag : string | boolean
>foo : Foo
>tag : string | boolean
>true : true
foo;
>foo : { tag: true; x: number; }
}
else {
foo;
>foo : { tag: false; y: number; } | { [x: string]: string; }
}
}
@@ -0,0 +1,40 @@
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(2,15): error TS2304: Cannot find name 'arguments'.
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(19,15): error TS2304: Cannot find name 'arguments'.
==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts (2 errors) ====
var a = () => {
var arg = arguments[0]; // error
~~~~~~~~~
!!! error TS2304: Cannot find name 'arguments'.
}
var b = function () {
var a = () => {
var arg = arguments[0]; // error
}
}
function baz() {
() => {
var arg = arguments[0];
}
}
function foo(inputFunc: () => void) { }
foo(() => {
var arg = arguments[0]; // error
~~~~~~~~~
!!! error TS2304: Cannot find name 'arguments'.
});
function bar() {
var arg = arguments[0]; // no error
}
() => {
function foo() {
var arg = arguments[0]; // no error
}
}
@@ -4,7 +4,6 @@ var a = () => {
var arg = arguments[0]; // error
>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 1, 7))
>arguments : Symbol(arguments)
}
var b = function () {
@@ -38,7 +37,6 @@ foo(() => {
var arg = arguments[0]; // error
>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 18, 7))
>arguments : Symbol(arguments)
});
@@ -6,7 +6,7 @@ var a = () => {
var arg = arguments[0]; // error
>arg : any
>arguments[0] : any
>arguments : IArguments
>arguments : any
>0 : 0
}
@@ -52,7 +52,7 @@ foo(() => {
var arg = arguments[0]; // error
>arg : any
>arguments[0] : any
>arguments : IArguments
>arguments : any
>0 : 0
});
@@ -0,0 +1,7 @@
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts(1,15): error TS2304: Cannot find name 'arguments'.
==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts (1 errors) ====
var a = () => arguments;
~~~~~~~~~
!!! error TS2304: Cannot find name 'arguments'.
@@ -1,5 +1,4 @@
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts ===
var a = () => arguments;
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments02_ES6.ts, 0, 3))
>arguments : Symbol(arguments)
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts ===
var a = () => arguments;
>a : () => IArguments
>() => arguments : () => IArguments
>arguments : IArguments
>a : () => any
>() => arguments : () => any
>arguments : any
@@ -4,5 +4,5 @@ var arguments;
var a = () => arguments;
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 1, 3))
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 0, 3))
@@ -3,7 +3,7 @@ var arguments;
>arguments : any
var a = () => arguments;
>a : () => IArguments
>() => arguments : () => IArguments
>arguments : IArguments
>a : () => any
>() => arguments : () => any
>arguments : any
@@ -7,5 +7,5 @@ function f() {
var a = () => arguments;
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 2, 7))
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 1, 7))
}
@@ -6,7 +6,7 @@ function f() {
>arguments : any
var a = () => arguments;
>a : () => IArguments
>() => arguments : () => IArguments
>arguments : IArguments
>a : () => any
>() => arguments : () => any
>arguments : any
}
@@ -5,5 +5,5 @@ function f(arguments) {
var a = () => arguments;
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 1, 7))
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 0, 11))
}
@@ -4,7 +4,7 @@ function f(arguments) {
>arguments : any
var a = () => arguments;
>a : () => IArguments
>() => arguments : () => IArguments
>arguments : IArguments
>a : () => any
>() => arguments : () => any
>arguments : any
}
@@ -5,5 +5,5 @@ function f(arguments) {
var a = () => () => arguments;
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 1, 7))
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 0, 11))
}
@@ -4,8 +4,8 @@ function f(arguments) {
>arguments : any
var a = () => () => arguments;
>a : () => () => IArguments
>() => () => arguments : () => () => IArguments
>() => arguments : () => IArguments
>arguments : IArguments
>a : () => () => any
>() => () => arguments : () => () => any
>() => arguments : () => any
>arguments : any
}
@@ -6,5 +6,5 @@ function f(arguments) {
var a = (arguments) => () => arguments;
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 1, 7))
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 1, 13))
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 1, 13))
}
@@ -4,9 +4,9 @@ function f(arguments) {
>arguments : any
var a = (arguments) => () => arguments;
>a : (arguments: any) => () => IArguments
>(arguments) => () => arguments : (arguments: any) => () => IArguments
>a : (arguments: any) => () => any
>(arguments) => () => arguments : (arguments: any) => () => any
>arguments : any
>() => arguments : () => any
>arguments : any
>() => arguments : () => IArguments
>arguments : IArguments
}
@@ -8,5 +8,5 @@ function f(arguments) {
var a = () => () => arguments;
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 2, 7))
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 0, 11))
}
@@ -8,8 +8,8 @@ function f(arguments) {
>10 : 10
var a = () => () => arguments;
>a : () => () => IArguments
>() => () => arguments : () => () => IArguments
>() => arguments : () => IArguments
>arguments : IArguments
>a : () => () => any
>() => () => arguments : () => () => any
>() => arguments : () => any
>arguments : any
}
@@ -8,6 +8,6 @@ class C {
var a = () => arguments;
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments12_ES6.ts, 2, 11))
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments12_ES6.ts, 1, 6))
}
}
@@ -7,8 +7,8 @@ class C {
>arguments : any
var a = () => arguments;
>a : () => IArguments
>() => arguments : () => IArguments
>arguments : IArguments
>a : () => any
>() => arguments : () => any
>arguments : any
}
}
@@ -11,6 +11,6 @@ function f() {
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 2, 11))
return () => arguments;
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 2, 11))
}
}
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts ===
function f() {
>f : () => () => IArguments
>f : () => () => number
if (Math.random()) {
>Math.random() : number
@@ -13,7 +13,7 @@ function f() {
>100 : 100
return () => arguments;
>() => arguments : () => IArguments
>arguments : IArguments
>() => arguments : () => number
>arguments : number
}
}
@@ -14,6 +14,6 @@ function f() {
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 3, 13))
return () => arguments;
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 3, 13))
}
}
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts ===
function f() {
>f : () => () => IArguments
>f : () => () => number
var arguments = "hello";
>arguments : string
@@ -17,7 +17,7 @@ function f() {
>100 : 100
return () => arguments;
>() => arguments : () => IArguments
>arguments : IArguments
>() => arguments : () => number
>arguments : 100
}
}
@@ -11,7 +11,7 @@ function f() {
>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
return () => arguments[0];
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 1, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 5, 7))
}
var arguments = "world";
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 1, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 5, 7))
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts ===
function f() {
>f : () => () => any
>f : () => () => string
var arguments = "hello";
>arguments : string
@@ -13,9 +13,9 @@ function f() {
>random : () => number
return () => arguments[0];
>() => arguments[0] : () => any
>arguments[0] : any
>arguments : IArguments
>() => arguments[0] : () => string
>arguments[0] : string
>arguments : string
>0 : 0
}
var arguments = "world";
@@ -12,7 +12,7 @@ function f() {
>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
return () => arguments[0];
>arguments : Symbol(arguments)
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 1, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 5, 7))
}
var arguments = "world";
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 1, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 5, 7))
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts ===
function f() {
>f : () => () => any
>f : () => () => string
var { arguments } = { arguments: "hello" };
>arguments : string
@@ -15,9 +15,9 @@ function f() {
>random : () => number
return () => arguments[0];
>() => arguments[0] : () => any
>arguments[0] : any
>arguments : IArguments
>() => arguments[0] : () => string
>arguments[0] : string
>arguments : string
>0 : 0
}
var arguments = "world";
@@ -69,20 +69,20 @@ tests/cases/compiler/externModule.ts(37,3): error TS2552: Cannot find name 'XDat
var d=new XDate();
~~~~~
!!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'?
!!! related TS2728 /.ts/lib.es5.d.ts:897:15: 'Date' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:907:15: 'Date' is declared here.
d.getDay();
d=new XDate(1978,2);
~~~~~
!!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'?
!!! related TS2728 /.ts/lib.es5.d.ts:897:15: 'Date' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:907:15: 'Date' is declared here.
d.getXDate();
var n=XDate.parse("3/2/2004");
~~~~~
!!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'?
!!! related TS2728 /.ts/lib.es5.d.ts:897:15: 'Date' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:907:15: 'Date' is declared here.
n=XDate.UTC(1964,2,1);
~~~~~
!!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'?
!!! related TS2728 /.ts/lib.es5.d.ts:897:15: 'Date' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:907:15: 'Date' is declared here.
@@ -0,0 +1,57 @@
tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments.
tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2558: Expected 4 type arguments, but got 5.
tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments.
tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2558: Expected 3 type arguments, but got 4.
tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/compiler/functionTypeArgumentArityErrors.ts(20,4): error TS2558: Expected 2-3 type arguments, but got 1.
tests/cases/compiler/functionTypeArgumentArityErrors.ts(21,4): error TS2558: Expected 2-3 type arguments, but got 4.
tests/cases/compiler/functionTypeArgumentArityErrors.ts(25,4): error TS2558: Expected 2 type arguments, but got 1.
tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Expected 2 type arguments, but got 3.
==== tests/cases/compiler/functionTypeArgumentArityErrors.ts (9 errors) ====
// Overloaded functions with default type arguments
declare function f1<A = any>(): void;
declare function f1<A, B, C, D = any>(): void;
f1<number, number>();
~~~~~~~~~~~~~~
!!! error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments.
f1<number, number, number, number, number>();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2558: Expected 4 type arguments, but got 5.
// Overloaded functions with no default type arguments
declare function f2<A>(): void;
declare function f2<A, B, C>(): void;
f2<number, number>();
~~~~~~~~~~~~~~
!!! error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments.
f2<number, number, number, number>();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2558: Expected 3 type arguments, but got 4.
// Overloaded non-generic functions
declare function f3(): void;
declare function f3(a): void;
f3<number>();
~~~~~~
!!! error TS2558: Expected 0 type arguments, but got 1.
// Generic function with default type parameters
declare function f4<A, B, C = any>(): void;
f4<number>();
~~~~~~
!!! error TS2558: Expected 2-3 type arguments, but got 1.
f4<number, number, number, number>();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2558: Expected 2-3 type arguments, but got 4.
// Generic function with no default type arguments
declare function f5<A, B>(): void;
f5<number>();
~~~~~~
!!! error TS2558: Expected 2 type arguments, but got 1.
f5<number, number, number>();
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2558: Expected 2 type arguments, but got 3.
@@ -0,0 +1,39 @@
//// [functionTypeArgumentArityErrors.ts]
// Overloaded functions with default type arguments
declare function f1<A = any>(): void;
declare function f1<A, B, C, D = any>(): void;
f1<number, number>();
f1<number, number, number, number, number>();
// Overloaded functions with no default type arguments
declare function f2<A>(): void;
declare function f2<A, B, C>(): void;
f2<number, number>();
f2<number, number, number, number>();
// Overloaded non-generic functions
declare function f3(): void;
declare function f3(a): void;
f3<number>();
// Generic function with default type parameters
declare function f4<A, B, C = any>(): void;
f4<number>();
f4<number, number, number, number>();
// Generic function with no default type arguments
declare function f5<A, B>(): void;
f5<number>();
f5<number, number, number>();
//// [functionTypeArgumentArityErrors.js]
f1();
f1();
f2();
f2();
f3();
f4();
f4();
f5();
f5();
@@ -0,0 +1,72 @@
=== tests/cases/compiler/functionTypeArgumentArityErrors.ts ===
// Overloaded functions with default type arguments
declare function f1<A = any>(): void;
>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37))
>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 1, 20))
declare function f1<A, B, C, D = any>(): void;
>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37))
>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 2, 20))
>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 2, 22))
>C : Symbol(C, Decl(functionTypeArgumentArityErrors.ts, 2, 25))
>D : Symbol(D, Decl(functionTypeArgumentArityErrors.ts, 2, 28))
f1<number, number>();
>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37))
f1<number, number, number, number, number>();
>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37))
// Overloaded functions with no default type arguments
declare function f2<A>(): void;
>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31))
>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 7, 20))
declare function f2<A, B, C>(): void;
>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31))
>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 8, 20))
>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 8, 22))
>C : Symbol(C, Decl(functionTypeArgumentArityErrors.ts, 8, 25))
f2<number, number>();
>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31))
f2<number, number, number, number>();
>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31))
// Overloaded non-generic functions
declare function f3(): void;
>f3 : Symbol(f3, Decl(functionTypeArgumentArityErrors.ts, 10, 37), Decl(functionTypeArgumentArityErrors.ts, 13, 28))
declare function f3(a): void;
>f3 : Symbol(f3, Decl(functionTypeArgumentArityErrors.ts, 10, 37), Decl(functionTypeArgumentArityErrors.ts, 13, 28))
>a : Symbol(a, Decl(functionTypeArgumentArityErrors.ts, 14, 20))
f3<number>();
>f3 : Symbol(f3, Decl(functionTypeArgumentArityErrors.ts, 10, 37), Decl(functionTypeArgumentArityErrors.ts, 13, 28))
// Generic function with default type parameters
declare function f4<A, B, C = any>(): void;
>f4 : Symbol(f4, Decl(functionTypeArgumentArityErrors.ts, 15, 13))
>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 18, 20))
>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 18, 22))
>C : Symbol(C, Decl(functionTypeArgumentArityErrors.ts, 18, 25))
f4<number>();
>f4 : Symbol(f4, Decl(functionTypeArgumentArityErrors.ts, 15, 13))
f4<number, number, number, number>();
>f4 : Symbol(f4, Decl(functionTypeArgumentArityErrors.ts, 15, 13))
// Generic function with no default type arguments
declare function f5<A, B>(): void;
>f5 : Symbol(f5, Decl(functionTypeArgumentArityErrors.ts, 20, 37))
>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 23, 20))
>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 23, 22))
f5<number>();
>f5 : Symbol(f5, Decl(functionTypeArgumentArityErrors.ts, 20, 37))
f5<number, number, number>();
>f5 : Symbol(f5, Decl(functionTypeArgumentArityErrors.ts, 20, 37))
@@ -0,0 +1,67 @@
=== tests/cases/compiler/functionTypeArgumentArityErrors.ts ===
// Overloaded functions with default type arguments
declare function f1<A = any>(): void;
>f1 : { <A = any>(): void; <A, B, C, D = any>(): void; }
declare function f1<A, B, C, D = any>(): void;
>f1 : { <A = any>(): void; <A, B, C, D = any>(): void; }
f1<number, number>();
>f1<number, number>() : any
>f1 : { <A = any>(): void; <A, B, C, D = any>(): void; }
f1<number, number, number, number, number>();
>f1<number, number, number, number, number>() : any
>f1 : { <A = any>(): void; <A, B, C, D = any>(): void; }
// Overloaded functions with no default type arguments
declare function f2<A>(): void;
>f2 : { <A>(): void; <A, B, C>(): void; }
declare function f2<A, B, C>(): void;
>f2 : { <A>(): void; <A, B, C>(): void; }
f2<number, number>();
>f2<number, number>() : any
>f2 : { <A>(): void; <A, B, C>(): void; }
f2<number, number, number, number>();
>f2<number, number, number, number>() : any
>f2 : { <A>(): void; <A, B, C>(): void; }
// Overloaded non-generic functions
declare function f3(): void;
>f3 : { (): void; (a: any): void; }
declare function f3(a): void;
>f3 : { (): void; (a: any): void; }
>a : any
f3<number>();
>f3<number>() : any
>f3 : { (): void; (a: any): void; }
// Generic function with default type parameters
declare function f4<A, B, C = any>(): void;
>f4 : <A, B, C = any>() => void
f4<number>();
>f4<number>() : any
>f4 : <A, B, C = any>() => void
f4<number, number, number, number>();
>f4<number, number, number, number>() : any
>f4 : <A, B, C = any>() => void
// Generic function with no default type arguments
declare function f5<A, B>(): void;
>f5 : <A, B>() => void
f5<number>();
>f5<number>() : any
>f5 : <A, B>() => void
f5<number, number, number>();
>f5<number, number, number>() : any
>f5 : <A, B>() => void
@@ -22,8 +22,8 @@ tests/cases/conformance/types/rest/genericRestParameters3.ts(31,21): error TS234
Property '0' is missing in type 'CoolArray<any>' but required in type '[(...args: any[]) => void]'.
tests/cases/conformance/types/rest/genericRestParameters3.ts(38,32): error TS2345: Argument of type '[10, 20]' is not assignable to parameter of type 'CoolArray<number>'.
Property 'hello' is missing in type '[10, 20]' but required in type 'CoolArray<number>'.
tests/cases/conformance/types/rest/genericRestParameters3.ts(43,1): error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray<never>'.
Property 'hello' is missing in type '[]' but required in type 'CoolArray<never>'.
tests/cases/conformance/types/rest/genericRestParameters3.ts(43,1): error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray<{}>'.
Property 'hello' is missing in type '[]' but required in type 'CoolArray<{}>'.
tests/cases/conformance/types/rest/genericRestParameters3.ts(44,5): error TS2345: Argument of type '[number]' is not assignable to parameter of type 'CoolArray<{}>'.
Property 'hello' is missing in type '[number]' but required in type 'CoolArray<{}>'.
tests/cases/conformance/types/rest/genericRestParameters3.ts(45,5): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type 'CoolArray<{}>'.
@@ -115,8 +115,8 @@ tests/cases/conformance/types/rest/genericRestParameters3.ts(53,5): error TS2345
baz(); // Error
~~~~~
!!! error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray<never>'.
!!! error TS2345: Property 'hello' is missing in type '[]' but required in type 'CoolArray<never>'.
!!! error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray<{}>'.
!!! error TS2345: Property 'hello' is missing in type '[]' but required in type 'CoolArray<{}>'.
!!! related TS2728 tests/cases/conformance/types/rest/genericRestParameters3.ts:24:5: 'hello' is declared here.
baz(1); // Error
~
@@ -0,0 +1,135 @@
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(1,16): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(3,2): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(3,2): error TS2304: Cannot find name 'a'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(4,4): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(4,4): error TS2304: Cannot find name 'a'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(5,3): error TS1124: Digit expected.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(5,4): error TS2538: Type 'null' cannot be used as an index type.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(6,5): error TS1124: Digit expected.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(6,6): error TS2538: Type 'null' cannot be used as an index type.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(7,2): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(8,4): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(9,3): error TS1124: Digit expected.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(9,3): error TS2304: Cannot find name 'n'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,5): error TS1124: Digit expected.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,5): error TS2304: Cannot find name 'n'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(11,2): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(11,2): error TS2304: Cannot find name 'a'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(12,4): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(12,4): error TS2304: Cannot find name 'a'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,4): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,4): error TS2304: Cannot find name 'abc'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(14,3): error TS1124: Digit expected.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(15,5): error TS1124: Digit expected.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(18,3): error TS1124: Digit expected.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(18,3): error TS2304: Cannot find name 'e'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(19,5): error TS1124: Digit expected.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(19,5): error TS2304: Cannot find name 'e'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(22,3): error TS1005: ';' expected.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(23,5): error TS1005: ';' expected.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(24,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(24,3): error TS2304: Cannot find name 'a'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(25,5): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(25,5): error TS2304: Cannot find name 'a'.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(26,5): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/identifierStartAfterNumericLiteral.ts(26,5): error TS2304: Cannot find name 'abc'.
==== tests/cases/compiler/identifierStartAfterNumericLiteral.ts (35 errors) ====
let valueIn = 3in[null];
~~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
3a[null]
~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~
!!! error TS2304: Cannot find name 'a'.
123a[null]
~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~
!!! error TS2304: Cannot find name 'a'.
3e[null]
!!! error TS1124: Digit expected.
~~~~
!!! error TS2538: Type 'null' cannot be used as an index type.
123e[null]
!!! error TS1124: Digit expected.
~~~~
!!! error TS2538: Type 'null' cannot be used as an index type.
3in[null]
~~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
123in[null]
~~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
3en[null]
!!! error TS1124: Digit expected.
~
!!! error TS2304: Cannot find name 'n'.
123en[null]
!!! error TS1124: Digit expected.
~
!!! error TS2304: Cannot find name 'n'.
1a
~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~
!!! error TS2304: Cannot find name 'a'.
123a
~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~
!!! error TS2304: Cannot find name 'a'.
123abc
~~~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~~~
!!! error TS2304: Cannot find name 'abc'.
1e
!!! error TS1124: Digit expected.
123e
!!! error TS1124: Digit expected.
1e9
123e9
1ee
!!! error TS1124: Digit expected.
~
!!! error TS2304: Cannot find name 'e'.
123ee
!!! error TS1124: Digit expected.
~
!!! error TS2304: Cannot find name 'e'.
1n
123n
2n2
~
!!! error TS1005: ';' expected.
123n2
~
!!! error TS1005: ';' expected.
2na
~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~
!!! error TS2304: Cannot find name 'a'.
123na
~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~
!!! error TS2304: Cannot find name 'a'.
123nabc
~~~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~~~
!!! error TS2304: Cannot find name 'abc'.
@@ -0,0 +1,69 @@
//// [identifierStartAfterNumericLiteral.ts]
let valueIn = 3in[null];
3a[null]
123a[null]
3e[null]
123e[null]
3in[null]
123in[null]
3en[null]
123en[null]
1a
123a
123abc
1e
123e
1e9
123e9
1ee
123ee
1n
123n
2n2
123n2
2na
123na
123nabc
//// [identifierStartAfterNumericLiteral.js]
var valueIn = 3 in [null];
3;
a[null];
123;
a[null];
3e[null];
123e[null];
3 in [null];
123 in [null];
3e;
n[null];
123e;
n[null];
1;
a;
123;
a;
123;
abc;
1e;
123e;
1e9;
123e9;
1e;
e;
123e;
e;
1n;
123n;
2n;
2;
123n;
2;
2n;
a;
123n;
a;
123n;
abc;
@@ -0,0 +1,29 @@
=== tests/cases/compiler/identifierStartAfterNumericLiteral.ts ===
let valueIn = 3in[null];
>valueIn : Symbol(valueIn, Decl(identifierStartAfterNumericLiteral.ts, 0, 3))
3a[null]
123a[null]
3e[null]
123e[null]
3in[null]
123in[null]
3en[null]
123en[null]
1a
123a
123abc
1e
123e
1e9
123e9
1ee
123ee
1n
123n
2n2
123n2
2na
123na
123nabc
@@ -0,0 +1,112 @@
=== tests/cases/compiler/identifierStartAfterNumericLiteral.ts ===
let valueIn = 3in[null];
>valueIn : boolean
>3in[null] : boolean
>3 : 3
>[null] : null[]
>null : null
3a[null]
>3 : 3
>a[null] : any
>a : any
>null : null
123a[null]
>123 : 123
>a[null] : any
>a : any
>null : null
3e[null]
>3e[null] : any
>3e : 3
>null : null
123e[null]
>123e[null] : any
>123e : 123
>null : null
3in[null]
>3in[null] : boolean
>3 : 3
>[null] : null[]
>null : null
123in[null]
>123in[null] : boolean
>123 : 123
>[null] : null[]
>null : null
3en[null]
>3e : 3
>n[null] : any
>n : any
>null : null
123en[null]
>123e : 123
>n[null] : any
>n : any
>null : null
1a
>1 : 1
>a : any
123a
>123 : 123
>a : any
123abc
>123 : 123
>abc : any
1e
>1e : 1
123e
>123e : 123
1e9
>1e9 : 1000000000
123e9
>123e9 : 123000000000
1ee
>1e : 1
>e : any
123ee
>123e : 123
>e : any
1n
>1n : 1n
123n
>123n : 123n
2n2
>2n : 2n
>2 : 2
123n2
>123n : 123n
>2 : 2
2na
>2n : 2n
>a : any
123na
>123n : 123n
>a : any
123nabc
>123n : 123n
>abc : any
@@ -41,7 +41,7 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.t
Math.sign(1);
~~~~
!!! error TS2551: Property 'sign' does not exist on type 'Math'. Did you mean 'sin'?
!!! related TS2728 /.ts/lib.es5.d.ts:703:5: 'sin' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:713:5: 'sin' is declared here.
// Using ES6 object
var o = {
@@ -24,7 +24,7 @@ tests/cases/conformance/types/any/narrowExceptionVariableInCatchClause.ts(16,17)
err.massage; // ERROR: Property 'massage' does not exist on type 'Error'
~~~~~~~
!!! error TS2551: Property 'massage' does not exist on type 'Error'. Did you mean 'message'?
!!! related TS2728 /.ts/lib.es5.d.ts:964:5: 'message' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:974:5: 'message' is declared here.
}
else {
@@ -22,7 +22,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS
x.mesage;
~~~~~~
!!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'?
!!! related TS2728 /.ts/lib.es5.d.ts:964:5: 'message' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:974:5: 'message' is declared here.
}
if (x instanceof Date) {
@@ -30,6 +30,6 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS
x.getHuors();
~~~~~~~~
!!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'?
!!! related TS2728 /.ts/lib.es5.d.ts:753:5: 'getHours' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:763:5: 'getHours' is declared here.
}
@@ -39,7 +39,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error
x.mesage;
~~~~~~
!!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'?
!!! related TS2728 /.ts/lib.es5.d.ts:964:5: 'message' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:974:5: 'message' is declared here.
}
if (isDate(x)) {
@@ -47,6 +47,6 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error
x.getHuors();
~~~~~~~~
!!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'?
!!! related TS2728 /.ts/lib.es5.d.ts:753:5: 'getHours' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:763:5: 'getHours' is declared here.
}
+2 -2
View File
@@ -1,8 +1,8 @@
tests/cases/compiler/newMap.ts(1,9): error TS2558: Expected 0-2 type arguments, but got 1.
tests/cases/compiler/newMap.ts(1,9): error TS2743: No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments.
==== tests/cases/compiler/newMap.ts (1 errors) ====
new Map<string>();
~~~~~~
!!! error TS2558: Expected 0-2 type arguments, but got 1.
!!! error TS2743: No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments.
@@ -1,5 +1,5 @@
tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(3,3): error TS1005: ';' expected.
tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,15): error TS1005: ',' expected.
tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(3,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,15): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,23): error TS1005: ',' expected.
tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error TS1109: Expression expected.
@@ -9,7 +9,7 @@ tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error
1.0.toString();
1.toString();
~~~~~~~~
!!! error TS1005: ';' expected.
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
1.+2.0 + 3. ;
// Preserve whitespace and comments where important for JS compatibility
@@ -17,7 +17,7 @@ tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error
var test1 = i.toString();
var test2 = 2.toString();
~~~~~~~~
!!! error TS1005: ',' expected.
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~
!!! error TS1005: ',' expected.
~
@@ -1,6 +1,6 @@
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 1-3 type arguments, but got 4.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'.
@@ -79,7 +79,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22):
// Generic overloads with differing arity called with type argument count that doesn't match any overload
fn3<number, number, number, number>(); // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2558: Expected 1-3 type arguments, but got 4.
!!! error TS2558: Expected 3 type arguments, but got 4.
// Generic overloads with constraints called with type arguments that satisfy the constraints
function fn4<T extends string, U extends number>(n: T, m: U);
@@ -1,6 +1,6 @@
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 1-3 type arguments, but got 4.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type arguments, but got 4.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'.
@@ -83,7 +83,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors
// Generic overloads with differing arity called with type argument count that doesn't match any overload
new fn3<number, number, number, number>(); // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2558: Expected 1-3 type arguments, but got 4.
!!! error TS2558: Expected 3 type arguments, but got 4.
// Generic overloads with constraints called with type arguments that satisfy the constraints
interface fn4 {
@@ -1,5 +1,5 @@
tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2558: Expected 0-2 type arguments, but got 3.
tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2558: Expected 0-2 type arguments, but got 3.
tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2558: Expected 2 type arguments, but got 3.
tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2558: Expected 2 type arguments, but got 3.
tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Expected 1 arguments, but got 0.
@@ -10,10 +10,10 @@ tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554:
Callbacks<number, string, boolean>('s'); // wrong number of type arguments
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2558: Expected 0-2 type arguments, but got 3.
!!! error TS2558: Expected 2 type arguments, but got 3.
new Callbacks<number, string, boolean>('s'); // wrong number of type arguments
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2558: Expected 0-2 type arguments, but got 3.
!!! error TS2558: Expected 2 type arguments, but got 3.
declare function f<A, B = {}>(arg: number): void;
f<number>(); // wrong number of arguments (#25683)
@@ -1,9 +1,9 @@
tests/cases/compiler/parseBigInt.ts(51,20): error TS2736: Operator '+' cannot be applied to type '123n'.
tests/cases/compiler/parseBigInt.ts(52,23): error TS2736: Operator '+' cannot be applied to type '291n'.
tests/cases/compiler/parseBigInt.ts(56,25): error TS1005: ',' expected.
tests/cases/compiler/parseBigInt.ts(57,25): error TS1005: ',' expected.
tests/cases/compiler/parseBigInt.ts(58,22): error TS1005: ',' expected.
tests/cases/compiler/parseBigInt.ts(59,28): error TS1005: ',' expected.
tests/cases/compiler/parseBigInt.ts(57,25): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/parseBigInt.ts(58,22): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/parseBigInt.ts(59,28): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/compiler/parseBigInt.ts(60,23): error TS1177: Binary digit expected.
tests/cases/compiler/parseBigInt.ts(61,20): error TS1178: Octal digit expected.
tests/cases/compiler/parseBigInt.ts(62,20): error TS1125: Hexadecimal digit expected.
@@ -82,13 +82,13 @@ tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' i
!!! error TS1005: ',' expected.
{ const scientific = 1e2n; }
~
!!! error TS1005: ',' expected.
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
{ const decimal = 4.1n; }
~
!!! error TS1005: ',' expected.
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
{ const leadingDecimal = .1n; }
~
!!! error TS1005: ',' expected.
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
const emptyBinary = 0bn; // should error but infer 0n
!!! error TS1177: Binary digit expected.
@@ -1,7 +1,7 @@
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts(1,5): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,2): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS2304: Cannot find name 'B0101'.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts(1,6): error TS6189: Multiple consecutive numeric separators are not permitted.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts(1,13): error TS6189: Multiple consecutive numeric separators are not permitted.
@@ -25,7 +25,7 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,5): error
~
!!! error TS6188: Numeric separators are not allowed here.
~~~~~
!!! error TS1005: ';' expected.
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~~~~~
!!! error TS2304: Cannot find name 'B0101'.
@@ -1,7 +1,7 @@
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts(1,5): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,2): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS2304: Cannot find name 'X0101'.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts(1,6): error TS6189: Multiple consecutive numeric separators are not permitted.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts(1,13): error TS6189: Multiple consecutive numeric separators are not permitted.
@@ -25,7 +25,7 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,5): error
~
!!! error TS6188: Numeric separators are not allowed here.
~~~~~
!!! error TS1005: ';' expected.
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~~~~~
!!! error TS2304: Cannot find name 'X0101'.
@@ -1,7 +1,7 @@
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts(1,5): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,2): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS2304: Cannot find name 'O0101'.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts(1,6): error TS6189: Multiple consecutive numeric separators are not permitted.
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts(1,13): error TS6189: Multiple consecutive numeric separators are not permitted.
@@ -25,7 +25,7 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,5): error
~
!!! error TS6188: Numeric separators are not allowed here.
~~~~~
!!! error TS1005: ';' expected.
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
~~~~~
!!! error TS2304: Cannot find name 'O0101'.
@@ -11,4 +11,4 @@ tests/cases/conformance/parser/ecmascript5/Expressions/parserMemberAccessAfterPo
!!! error TS1005: ';' expected.
~~~~~~~~
!!! error TS2552: Cannot find name 'toString'. Did you mean 'String'?
!!! related TS2728 /.ts/lib.es5.d.ts:517:15: 'String' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:527:15: 'String' is declared here.
@@ -19,7 +19,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS
$ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x));
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
//CHECK#2
@@ -28,7 +28,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS
$ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x));
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
@@ -21,7 +21,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.3_A1.1_T2.ts(17,3): error TS
$ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x));
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
@@ -50,70 +50,70 @@ tests/cases/conformance/parser/ecmascript5/parserS7.6_A4.2_T1.ts(142,3): error T
$ERROR('#А');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0411 = 1;
if (Б !== 1) {
$ERROR('#Б');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0412 = 1;
if (В !== 1) {
$ERROR('#В');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0413 = 1;
if (Г !== 1) {
$ERROR('#Г');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0414 = 1;
if (Д !== 1) {
$ERROR('#Д');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0415 = 1;
if (Е !== 1) {
$ERROR('#Е');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0416 = 1;
if (Ж !== 1) {
$ERROR('#Ж');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0417 = 1;
if (З !== 1) {
$ERROR('#З');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0418 = 1;
if (И !== 1) {
$ERROR('#И');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0419 = 1;
if (Й !== 1) {
$ERROR('#Й');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u041A = 1;
if (К !== 1) {
@@ -11,13 +11,13 @@ tests/cases/conformance/parser/ecmascript5/parserUnicode1.ts(10,5): error TS2552
$ERROR('#6.1: var \\u0078x = 1; xx === 6. Actual: ' + (xx));
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
}
catch (e) {
$ERROR('#6.2: var \\u0078x = 1; xx === 6. Actual: ' + (xx));
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
@@ -295,7 +295,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t
~~~~~~~~~
!!! error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
!!! error TS2345: Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
!!! related TS2728 /.ts/lib.es5.d.ts:1403:5: 'catch' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here.
var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok
var r11: IPromise<number>;
@@ -294,7 +294,7 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
~~~~~~~~~
!!! error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
!!! error TS2345: Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
!!! related TS2728 /.ts/lib.es5.d.ts:1403:5: 'catch' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here.
var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok
var r11: IPromise<number>;
@@ -303,7 +303,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
~~~~~~~~~
!!! error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
!!! error TS2345: Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
!!! related TS2728 /.ts/lib.es5.d.ts:1403:5: 'catch' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here.
var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok
var r11: IPromise<number>;
@@ -340,5 +340,5 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ <T>(x: T): IPromise<T>; <T>(x: T, y: T): Promise<T>; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<{}>'.
!!! error TS2345: Property 'catch' is missing in type 'IPromise<any>' but required in type 'Promise<{}>'.
!!! related TS2728 /.ts/lib.es5.d.ts:1403:5: 'catch' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here.
var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok
@@ -26,5 +26,5 @@ tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2322: Type 'IPromis
!!! error TS2322: Types of parameters 'success' and 'onfulfilled' are incompatible.
!!! error TS2322: Type 'TResult1 | PromiseLike<TResult1>' is not assignable to type 'IPromise<TResult1 | TResult2>'.
!!! error TS2322: Type 'TResult1' is not assignable to type 'IPromise<TResult1 | TResult2>'.
!!! related TS6502 /.ts/lib.es5.d.ts:1396:57: The expected type comes from the return type of this signature.
!!! related TS6502 /.ts/lib.es5.d.ts:1406:57: The expected type comes from the return type of this signature.
@@ -19,7 +19,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts(20,3): error
$ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x));
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
//CHECK#2
@@ -28,7 +28,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts(20,3): error
$ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x));
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
@@ -21,7 +21,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.3_A1.1_T2.ts(17,3): error
$ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x));
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
@@ -50,70 +50,70 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.6_A4.2_T1.ts(142,3): error
$ERROR('#А');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0411 = 1;
if (Б !== 1) {
$ERROR('#Б');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0412 = 1;
if (В !== 1) {
$ERROR('#В');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0413 = 1;
if (Г !== 1) {
$ERROR('#Г');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0414 = 1;
if (Д !== 1) {
$ERROR('#Д');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0415 = 1;
if (Е !== 1) {
$ERROR('#Е');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0416 = 1;
if (Ж !== 1) {
$ERROR('#Ж');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0417 = 1;
if (З !== 1) {
$ERROR('#З');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0418 = 1;
if (И !== 1) {
$ERROR('#И');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u0419 = 1;
if (Й !== 1) {
$ERROR('#Й');
~~~~~~
!!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'?
!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here.
}
var \u041A = 1;
if (К !== 1) {
@@ -1,35 +1,40 @@
tests/cases/conformance/functions/strictBindCallApply1.ts(6,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(9,11): error TS2554: Expected 3 arguments, but got 2.
tests/cases/conformance/functions/strictBindCallApply1.ts(10,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(14,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(11,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(17,11): error TS2554: Expected 3 arguments, but got 2.
tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(19,11): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(22,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
Property '1' is missing in type '[number]' but required in type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(15,37): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(16,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'.
Types of property 'length' are incompatible.
Type '3' is not assignable to type '2'.
tests/cases/conformance/functions/strictBindCallApply1.ts(29,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(30,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
tests/cases/conformance/functions/strictBindCallApply1.ts(33,11): error TS2554: Expected 3 arguments, but got 2.
tests/cases/conformance/functions/strictBindCallApply1.ts(34,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(35,11): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(36,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
tests/cases/conformance/functions/strictBindCallApply1.ts(39,26): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(40,31): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(41,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(42,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
tests/cases/conformance/functions/strictBindCallApply1.ts(47,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(50,1): error TS2554: Expected 3 arguments, but got 2.
tests/cases/conformance/functions/strictBindCallApply1.ts(51,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(52,1): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(55,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(56,17): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(41,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(42,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
tests/cases/conformance/functions/strictBindCallApply1.ts(48,11): error TS2554: Expected 3 arguments, but got 2.
tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(50,11): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(51,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
tests/cases/conformance/functions/strictBindCallApply1.ts(62,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(65,1): error TS2554: Expected 3 arguments, but got 2.
tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(67,1): error TS2554: Expected 3 arguments, but got 4.
tests/cases/conformance/functions/strictBindCallApply1.ts(70,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
tests/cases/conformance/functions/strictBindCallApply1.ts(71,17): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'.
==== tests/cases/conformance/functions/strictBindCallApply1.ts (24 errors) ====
declare function foo(a: number, b: string): string;
declare function overloaded(s: string): number;
declare function overloaded(n: number): string;
declare function generic<T>(x: T): T;
let f00 = foo.bind(undefined);
let f01 = foo.bind(undefined, 10);
let f02 = foo.bind(undefined, 10, "hello");
@@ -37,6 +42,9 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345:
~~
!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
let f04 = overloaded.bind(undefined); // typeof overloaded
let f05 = generic.bind(undefined); // typeof generic
let c00 = foo.call(undefined, 10, "hello");
let c01 = foo.call(undefined, 10); // Error
~~~~~~~~~~~~~~~~~~~~~~~
@@ -65,6 +73,10 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345:
class C {
constructor(a: number, b: string) {}
foo(this: this, a: number, b: string): string { return "" }
overloaded(s: string): number;
overloaded(n: number): string;
overloaded(x: any): any { return <any>undefined }
generic<T>(x: T): T { return x }
}
declare let c: C;
@@ -80,6 +92,9 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345:
~~~~~~~~~
!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded
let f16 = c.generic.bind(c); // typeof C.prototype.generic
let c10 = c.foo.call(c, 10, "hello");
let c11 = c.foo.call(c, 10); // Error
~~~~~~~~~~~~~~~~~
@@ -1,11 +1,19 @@
//// [strictBindCallApply1.ts]
declare function foo(a: number, b: string): string;
declare function overloaded(s: string): number;
declare function overloaded(n: number): string;
declare function generic<T>(x: T): T;
let f00 = foo.bind(undefined);
let f01 = foo.bind(undefined, 10);
let f02 = foo.bind(undefined, 10, "hello");
let f03 = foo.bind(undefined, 10, 20); // Error
let f04 = overloaded.bind(undefined); // typeof overloaded
let f05 = generic.bind(undefined); // typeof generic
let c00 = foo.call(undefined, 10, "hello");
let c01 = foo.call(undefined, 10); // Error
let c02 = foo.call(undefined, 10, 20); // Error
@@ -19,6 +27,10 @@ let a03 = foo.apply(undefined, [10, "hello", 30]); // Error
class C {
constructor(a: number, b: string) {}
foo(this: this, a: number, b: string): string { return "" }
overloaded(s: string): number;
overloaded(n: number): string;
overloaded(x: any): any { return <any>undefined }
generic<T>(x: T): T { return x }
}
declare let c: C;
@@ -30,6 +42,9 @@ let f12 = c.foo.bind(c, 10, "hello");
let f13 = c.foo.bind(c, 10, 20); // Error
let f14 = c.foo.bind(undefined); // Error
let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded
let f16 = c.generic.bind(c); // typeof C.prototype.generic
let c10 = c.foo.call(c, 10, "hello");
let c11 = c.foo.call(c, 10); // Error
let c12 = c.foo.call(c, 10, 20); // Error
@@ -64,6 +79,8 @@ var f00 = foo.bind(undefined);
var f01 = foo.bind(undefined, 10);
var f02 = foo.bind(undefined, 10, "hello");
var f03 = foo.bind(undefined, 10, 20); // Error
var f04 = overloaded.bind(undefined); // typeof overloaded
var f05 = generic.bind(undefined); // typeof generic
var c00 = foo.call(undefined, 10, "hello");
var c01 = foo.call(undefined, 10); // Error
var c02 = foo.call(undefined, 10, 20); // Error
@@ -76,6 +93,8 @@ var C = /** @class */ (function () {
function C(a, b) {
}
C.prototype.foo = function (a, b) { return ""; };
C.prototype.overloaded = function (x) { return undefined; };
C.prototype.generic = function (x) { return x; };
return C;
}());
var f10 = c.foo.bind(c);
@@ -83,6 +102,8 @@ var f11 = c.foo.bind(c, 10);
var f12 = c.foo.bind(c, 10, "hello");
var f13 = c.foo.bind(c, 10, 20); // Error
var f14 = c.foo.bind(undefined); // Error
var f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded
var f16 = c.generic.bind(c); // typeof C.prototype.generic
var c10 = c.foo.call(c, 10, "hello");
var c11 = c.foo.call(c, 10); // Error
var c12 = c.foo.call(c, 10, 20); // Error
@@ -4,319 +4,387 @@ declare function foo(a: number, b: string): string;
>a : Symbol(a, Decl(strictBindCallApply1.ts, 0, 21))
>b : Symbol(b, Decl(strictBindCallApply1.ts, 0, 31))
declare function overloaded(s: string): number;
>overloaded : Symbol(overloaded, Decl(strictBindCallApply1.ts, 0, 51), Decl(strictBindCallApply1.ts, 2, 47))
>s : Symbol(s, Decl(strictBindCallApply1.ts, 2, 28))
declare function overloaded(n: number): string;
>overloaded : Symbol(overloaded, Decl(strictBindCallApply1.ts, 0, 51), Decl(strictBindCallApply1.ts, 2, 47))
>n : Symbol(n, Decl(strictBindCallApply1.ts, 3, 28))
declare function generic<T>(x: T): T;
>generic : Symbol(generic, Decl(strictBindCallApply1.ts, 3, 47))
>T : Symbol(T, Decl(strictBindCallApply1.ts, 5, 25))
>x : Symbol(x, Decl(strictBindCallApply1.ts, 5, 28))
>T : Symbol(T, Decl(strictBindCallApply1.ts, 5, 25))
>T : Symbol(T, Decl(strictBindCallApply1.ts, 5, 25))
let f00 = foo.bind(undefined);
>f00 : Symbol(f00, Decl(strictBindCallApply1.ts, 2, 3))
>f00 : Symbol(f00, Decl(strictBindCallApply1.ts, 7, 3))
>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
let f01 = foo.bind(undefined, 10);
>f01 : Symbol(f01, Decl(strictBindCallApply1.ts, 3, 3))
>f01 : Symbol(f01, Decl(strictBindCallApply1.ts, 8, 3))
>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
let f02 = foo.bind(undefined, 10, "hello");
>f02 : Symbol(f02, Decl(strictBindCallApply1.ts, 4, 3))
>f02 : Symbol(f02, Decl(strictBindCallApply1.ts, 9, 3))
>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
let f03 = foo.bind(undefined, 10, 20); // Error
>f03 : Symbol(f03, Decl(strictBindCallApply1.ts, 5, 3))
>f03 : Symbol(f03, Decl(strictBindCallApply1.ts, 10, 3))
>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
let f04 = overloaded.bind(undefined); // typeof overloaded
>f04 : Symbol(f04, Decl(strictBindCallApply1.ts, 12, 3))
>overloaded.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>overloaded : Symbol(overloaded, Decl(strictBindCallApply1.ts, 0, 51), Decl(strictBindCallApply1.ts, 2, 47))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
let f05 = generic.bind(undefined); // typeof generic
>f05 : Symbol(f05, Decl(strictBindCallApply1.ts, 13, 3))
>generic.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>generic : Symbol(generic, Decl(strictBindCallApply1.ts, 3, 47))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
let c00 = foo.call(undefined, 10, "hello");
>c00 : Symbol(c00, Decl(strictBindCallApply1.ts, 7, 3))
>c00 : Symbol(c00, Decl(strictBindCallApply1.ts, 15, 3))
>foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
let c01 = foo.call(undefined, 10); // Error
>c01 : Symbol(c01, Decl(strictBindCallApply1.ts, 8, 3))
>c01 : Symbol(c01, Decl(strictBindCallApply1.ts, 16, 3))
>foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
let c02 = foo.call(undefined, 10, 20); // Error
>c02 : Symbol(c02, Decl(strictBindCallApply1.ts, 9, 3))
>c02 : Symbol(c02, Decl(strictBindCallApply1.ts, 17, 3))
>foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
let c03 = foo.call(undefined, 10, "hello", 30); // Error
>c03 : Symbol(c03, Decl(strictBindCallApply1.ts, 10, 3))
>c03 : Symbol(c03, Decl(strictBindCallApply1.ts, 18, 3))
>foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
let a00 = foo.apply(undefined, [10, "hello"]);
>a00 : Symbol(a00, Decl(strictBindCallApply1.ts, 12, 3))
>a00 : Symbol(a00, Decl(strictBindCallApply1.ts, 20, 3))
>foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
let a01 = foo.apply(undefined, [10]); // Error
>a01 : Symbol(a01, Decl(strictBindCallApply1.ts, 13, 3))
>a01 : Symbol(a01, Decl(strictBindCallApply1.ts, 21, 3))
>foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
let a02 = foo.apply(undefined, [10, 20]); // Error
>a02 : Symbol(a02, Decl(strictBindCallApply1.ts, 14, 3))
>a02 : Symbol(a02, Decl(strictBindCallApply1.ts, 22, 3))
>foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
let a03 = foo.apply(undefined, [10, "hello", 30]); // Error
>a03 : Symbol(a03, Decl(strictBindCallApply1.ts, 15, 3))
>a03 : Symbol(a03, Decl(strictBindCallApply1.ts, 23, 3))
>foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0))
>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
class C {
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
constructor(a: number, b: string) {}
>a : Symbol(a, Decl(strictBindCallApply1.ts, 18, 16))
>b : Symbol(b, Decl(strictBindCallApply1.ts, 18, 26))
>a : Symbol(a, Decl(strictBindCallApply1.ts, 26, 16))
>b : Symbol(b, Decl(strictBindCallApply1.ts, 26, 26))
foo(this: this, a: number, b: string): string { return "" }
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>this : Symbol(this, Decl(strictBindCallApply1.ts, 19, 8))
>a : Symbol(a, Decl(strictBindCallApply1.ts, 19, 19))
>b : Symbol(b, Decl(strictBindCallApply1.ts, 19, 30))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>this : Symbol(this, Decl(strictBindCallApply1.ts, 27, 8))
>a : Symbol(a, Decl(strictBindCallApply1.ts, 27, 19))
>b : Symbol(b, Decl(strictBindCallApply1.ts, 27, 30))
overloaded(s: string): number;
>overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34))
>s : Symbol(s, Decl(strictBindCallApply1.ts, 28, 15))
overloaded(n: number): string;
>overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34))
>n : Symbol(n, Decl(strictBindCallApply1.ts, 29, 15))
overloaded(x: any): any { return <any>undefined }
>overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34))
>x : Symbol(x, Decl(strictBindCallApply1.ts, 30, 15))
>undefined : Symbol(undefined)
generic<T>(x: T): T { return x }
>generic : Symbol(C.generic, Decl(strictBindCallApply1.ts, 30, 53))
>T : Symbol(T, Decl(strictBindCallApply1.ts, 31, 12))
>x : Symbol(x, Decl(strictBindCallApply1.ts, 31, 15))
>T : Symbol(T, Decl(strictBindCallApply1.ts, 31, 12))
>T : Symbol(T, Decl(strictBindCallApply1.ts, 31, 12))
>x : Symbol(x, Decl(strictBindCallApply1.ts, 31, 15))
}
declare let c: C;
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
declare let obj: {};
>obj : Symbol(obj, Decl(strictBindCallApply1.ts, 23, 11))
>obj : Symbol(obj, Decl(strictBindCallApply1.ts, 35, 11))
let f10 = c.foo.bind(c);
>f10 : Symbol(f10, Decl(strictBindCallApply1.ts, 25, 3))
>f10 : Symbol(f10, Decl(strictBindCallApply1.ts, 37, 3))
>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let f11 = c.foo.bind(c, 10);
>f11 : Symbol(f11, Decl(strictBindCallApply1.ts, 26, 3))
>f11 : Symbol(f11, Decl(strictBindCallApply1.ts, 38, 3))
>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let f12 = c.foo.bind(c, 10, "hello");
>f12 : Symbol(f12, Decl(strictBindCallApply1.ts, 27, 3))
>f12 : Symbol(f12, Decl(strictBindCallApply1.ts, 39, 3))
>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let f13 = c.foo.bind(c, 10, 20); // Error
>f13 : Symbol(f13, Decl(strictBindCallApply1.ts, 28, 3))
>f13 : Symbol(f13, Decl(strictBindCallApply1.ts, 40, 3))
>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let f14 = c.foo.bind(undefined); // Error
>f14 : Symbol(f14, Decl(strictBindCallApply1.ts, 29, 3))
>f14 : Symbol(f14, Decl(strictBindCallApply1.ts, 41, 3))
>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded
>f15 : Symbol(f15, Decl(strictBindCallApply1.ts, 43, 3))
>c.overloaded.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c.overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let f16 = c.generic.bind(c); // typeof C.prototype.generic
>f16 : Symbol(f16, Decl(strictBindCallApply1.ts, 44, 3))
>c.generic.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c.generic : Symbol(C.generic, Decl(strictBindCallApply1.ts, 30, 53))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>generic : Symbol(C.generic, Decl(strictBindCallApply1.ts, 30, 53))
>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let c10 = c.foo.call(c, 10, "hello");
>c10 : Symbol(c10, Decl(strictBindCallApply1.ts, 31, 3))
>c10 : Symbol(c10, Decl(strictBindCallApply1.ts, 46, 3))
>c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let c11 = c.foo.call(c, 10); // Error
>c11 : Symbol(c11, Decl(strictBindCallApply1.ts, 32, 3))
>c11 : Symbol(c11, Decl(strictBindCallApply1.ts, 47, 3))
>c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let c12 = c.foo.call(c, 10, 20); // Error
>c12 : Symbol(c12, Decl(strictBindCallApply1.ts, 33, 3))
>c12 : Symbol(c12, Decl(strictBindCallApply1.ts, 48, 3))
>c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let c13 = c.foo.call(c, 10, "hello", 30); // Error
>c13 : Symbol(c13, Decl(strictBindCallApply1.ts, 34, 3))
>c13 : Symbol(c13, Decl(strictBindCallApply1.ts, 49, 3))
>c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let c14 = c.foo.call(undefined, 10, "hello"); // Error
>c14 : Symbol(c14, Decl(strictBindCallApply1.ts, 35, 3))
>c14 : Symbol(c14, Decl(strictBindCallApply1.ts, 50, 3))
>c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
let a10 = c.foo.apply(c, [10, "hello"]);
>a10 : Symbol(a10, Decl(strictBindCallApply1.ts, 37, 3))
>a10 : Symbol(a10, Decl(strictBindCallApply1.ts, 52, 3))
>c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let a11 = c.foo.apply(c, [10]); // Error
>a11 : Symbol(a11, Decl(strictBindCallApply1.ts, 38, 3))
>a11 : Symbol(a11, Decl(strictBindCallApply1.ts, 53, 3))
>c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let a12 = c.foo.apply(c, [10, 20]); // Error
>a12 : Symbol(a12, Decl(strictBindCallApply1.ts, 39, 3))
>a12 : Symbol(a12, Decl(strictBindCallApply1.ts, 54, 3))
>c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let a13 = c.foo.apply(c, [10, "hello", 30]); // Error
>a13 : Symbol(a13, Decl(strictBindCallApply1.ts, 40, 3))
>a13 : Symbol(a13, Decl(strictBindCallApply1.ts, 55, 3))
>c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
let a14 = c.foo.apply(undefined, [10, "hello"]); // Error
>a14 : Symbol(a14, Decl(strictBindCallApply1.ts, 41, 3))
>a14 : Symbol(a14, Decl(strictBindCallApply1.ts, 56, 3))
>c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40))
>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40))
>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
let f20 = C.bind(undefined);
>f20 : Symbol(f20, Decl(strictBindCallApply1.ts, 43, 3))
>f20 : Symbol(f20, Decl(strictBindCallApply1.ts, 58, 3))
>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
let f21 = C.bind(undefined, 10);
>f21 : Symbol(f21, Decl(strictBindCallApply1.ts, 44, 3))
>f21 : Symbol(f21, Decl(strictBindCallApply1.ts, 59, 3))
>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
let f22 = C.bind(undefined, 10, "hello");
>f22 : Symbol(f22, Decl(strictBindCallApply1.ts, 45, 3))
>f22 : Symbol(f22, Decl(strictBindCallApply1.ts, 60, 3))
>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
let f23 = C.bind(undefined, 10, 20); // Error
>f23 : Symbol(f23, Decl(strictBindCallApply1.ts, 46, 3))
>f23 : Symbol(f23, Decl(strictBindCallApply1.ts, 61, 3))
>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more)
>undefined : Symbol(undefined)
C.call(c, 10, "hello");
>C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
C.call(c, 10); // Error
>C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
C.call(c, 10, 20); // Error
>C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
C.call(c, 10, "hello", 30); // Error
>C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
C.apply(c, [10, "hello"]);
>C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
C.apply(c, [10]); // Error
>C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
C.apply(c, [10, 20]); // Error
>C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
C.apply(c, [10, "hello", 30]); // Error
>C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50))
>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50))
>apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11))
>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11))
@@ -4,29 +4,41 @@ declare function foo(a: number, b: string): string;
>a : number
>b : string
declare function overloaded(s: string): number;
>overloaded : { (s: string): number; (n: number): string; }
>s : string
declare function overloaded(n: number): string;
>overloaded : { (s: string): number; (n: number): string; }
>n : number
declare function generic<T>(x: T): T;
>generic : <T>(x: T) => T
>x : T
let f00 = foo.bind(undefined);
>f00 : (a: number, b: string) => string
>foo.bind(undefined) : (a: number, b: string) => string
>foo.bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>foo.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>foo : (a: number, b: string) => string
>bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>undefined : undefined
let f01 = foo.bind(undefined, 10);
>f01 : (b: string) => string
>foo.bind(undefined, 10) : (b: string) => string
>foo.bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>foo.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>foo : (a: number, b: string) => string
>bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>undefined : undefined
>10 : 10
let f02 = foo.bind(undefined, 10, "hello");
>f02 : () => string
>foo.bind(undefined, 10, "hello") : () => string
>foo.bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>foo.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>foo : (a: number, b: string) => string
>bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>undefined : undefined
>10 : 10
>"hello" : "hello"
@@ -34,13 +46,29 @@ let f02 = foo.bind(undefined, 10, "hello");
let f03 = foo.bind(undefined, 10, 20); // Error
>f03 : any
>foo.bind(undefined, 10, 20) : any
>foo.bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>foo.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>foo : (a: number, b: string) => string
>bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>undefined : undefined
>10 : 10
>20 : 20
let f04 = overloaded.bind(undefined); // typeof overloaded
>f04 : { (s: string): number; (n: number): string; }
>overloaded.bind(undefined) : { (s: string): number; (n: number): string; }
>overloaded.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>overloaded : { (s: string): number; (n: number): string; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>undefined : undefined
let f05 = generic.bind(undefined); // typeof generic
>f05 : <T>(x: T) => T
>generic.bind(undefined) : <T>(x: T) => T
>generic.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>generic : <T>(x: T) => T
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>undefined : undefined
let c00 = foo.call(undefined, 10, "hello");
>c00 : string
>foo.call(undefined, 10, "hello") : string
@@ -138,6 +166,25 @@ class C {
>a : number
>b : string
>"" : ""
overloaded(s: string): number;
>overloaded : { (s: string): number; (n: number): string; }
>s : string
overloaded(n: number): string;
>overloaded : { (s: string): number; (n: number): string; }
>n : number
overloaded(x: any): any { return <any>undefined }
>overloaded : { (s: string): number; (n: number): string; }
>x : any
><any>undefined : any
>undefined : undefined
generic<T>(x: T): T { return x }
>generic : <T>(x: T) => T
>x : T
>x : T
}
declare let c: C;
@@ -149,32 +196,32 @@ declare let obj: {};
let f10 = c.foo.bind(c);
>f10 : (a: number, b: string) => string
>c.foo.bind(c) : (a: number, b: string) => string
>c.foo.bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.foo.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.foo : (this: C, a: number, b: string) => string
>c : C
>foo : (this: C, a: number, b: string) => string
>bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c : C
let f11 = c.foo.bind(c, 10);
>f11 : (b: string) => string
>c.foo.bind(c, 10) : (b: string) => string
>c.foo.bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.foo.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.foo : (this: C, a: number, b: string) => string
>c : C
>foo : (this: C, a: number, b: string) => string
>bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c : C
>10 : 10
let f12 = c.foo.bind(c, 10, "hello");
>f12 : () => string
>c.foo.bind(c, 10, "hello") : () => string
>c.foo.bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.foo.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.foo : (this: C, a: number, b: string) => string
>c : C
>foo : (this: C, a: number, b: string) => string
>bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c : C
>10 : 10
>"hello" : "hello"
@@ -182,11 +229,11 @@ let f12 = c.foo.bind(c, 10, "hello");
let f13 = c.foo.bind(c, 10, 20); // Error
>f13 : any
>c.foo.bind(c, 10, 20) : any
>c.foo.bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.foo.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.foo : (this: C, a: number, b: string) => string
>c : C
>foo : (this: C, a: number, b: string) => string
>bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c : C
>10 : 10
>20 : 20
@@ -194,13 +241,33 @@ let f13 = c.foo.bind(c, 10, 20); // Error
let f14 = c.foo.bind(undefined); // Error
>f14 : any
>c.foo.bind(undefined) : any
>c.foo.bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.foo.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.foo : (this: C, a: number, b: string) => string
>c : C
>foo : (this: C, a: number, b: string) => string
>bind : { <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>undefined : undefined
let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded
>f15 : { (s: string): number; (n: number): string; }
>c.overloaded.bind(c) : { (s: string): number; (n: number): string; }
>c.overloaded.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.overloaded : { (s: string): number; (n: number): string; }
>c : C
>overloaded : { (s: string): number; (n: number): string; }
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c : C
let f16 = c.generic.bind(c); // typeof C.prototype.generic
>f16 : <T>(x: T) => T
>c.generic.bind(c) : <T>(x: T) => T
>c.generic.bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c.generic : <T>(x: T) => T
>c : C
>generic : <T>(x: T) => T
>bind : { <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; <T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; <T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; <T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; <T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; <T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; }
>c : C
let c10 = c.foo.call(c, 10, "hello");
>c10 : string
>c.foo.call(c, 10, "hello") : string
@@ -327,28 +394,28 @@ let a14 = c.foo.apply(undefined, [10, "hello"]); // Error
>"hello" : "hello"
let f20 = C.bind(undefined);
>f20 : new (a: number, b: string) => C
>C.bind(undefined) : new (a: number, b: string) => C
>C.bind : { <A extends any[], R>(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>f20 : typeof C
>C.bind(undefined) : typeof C
>C.bind : { <T>(this: T, thisArg: any): T; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>C : typeof C
>bind : { <A extends any[], R>(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: any): T; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>undefined : undefined
let f21 = C.bind(undefined, 10);
>f21 : new (b: string) => C
>C.bind(undefined, 10) : new (b: string) => C
>C.bind : { <A extends any[], R>(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>C.bind : { <T>(this: T, thisArg: any): T; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>C : typeof C
>bind : { <A extends any[], R>(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: any): T; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>undefined : undefined
>10 : 10
let f22 = C.bind(undefined, 10, "hello");
>f22 : new () => C
>C.bind(undefined, 10, "hello") : new () => C
>C.bind : { <A extends any[], R>(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>C.bind : { <T>(this: T, thisArg: any): T; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>C : typeof C
>bind : { <A extends any[], R>(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: any): T; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>undefined : undefined
>10 : 10
>"hello" : "hello"
@@ -356,9 +423,9 @@ let f22 = C.bind(undefined, 10, "hello");
let f23 = C.bind(undefined, 10, 20); // Error
>f23 : any
>C.bind(undefined, 10, 20) : any
>C.bind : { <A extends any[], R>(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>C.bind : { <T>(this: T, thisArg: any): T; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>C : typeof C
>bind : { <A extends any[], R>(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>bind : { <T>(this: T, thisArg: any): T; <A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; <A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; <A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; <A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; <AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; }
>undefined : undefined
>10 : 10
>20 : 20
Loaded 100 of 117 files, more files were not shown because too many files have changed in this diff. Show more