Merge pull request #28920 from Microsoft/improveBindTyping

Improve 'bind' typing in --strictBindCallApply mode
This commit is contained in:
Anders Hejlsberg
2018-12-10 10:28:37 -08:00
committed by GitHub
28 changed files with 423 additions and 221 deletions

View File

@@ -4450,6 +4450,8 @@ namespace FourSlashInterface {
interfaceEntry("ObjectConstructor"),
constEntry("Function"),
interfaceEntry("FunctionConstructor"),
typeEntry("ThisParameterType"),
typeEntry("OmitThisParameter"),
interfaceEntry("CallableFunction"),
interfaceEntry("NewableFunction"),
interfaceEntry("IArguments"),

14
src/lib/es5.d.ts vendored
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;

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));

View File

@@ -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]]'.

View File

@@ -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.

View File

@@ -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 = {

View File

@@ -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 {

View File

@@ -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.
}

View File

@@ -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.
}

View File

@@ -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.

View File

@@ -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.
}

View File

@@ -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.
}

View File

@@ -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) {

View File

@@ -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.
}

View File

@@ -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>;

View File

@@ -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>;

View File

@@ -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

View File

@@ -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.

View File

@@ -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.
}

View File

@@ -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.
}

View File

@@ -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) {

View File

@@ -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
~~~~~~~~~~~~~~~~~

View File

@@ -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

View File

@@ -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))

View File

@@ -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

View File

@@ -22,7 +22,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! error TS2345: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
!!! related TS2728 /.ts/lib.es5.d.ts:595:14: 'raw' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:605:14: 'raw' is declared here.
var b = foo([], 1); // string
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.

View File

@@ -22,7 +22,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! error TS2345: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
!!! related TS2728 /.ts/lib.es5.d.ts:595:14: 'raw' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:605:14: 'raw' is declared here.
var b = foo([], 1); // string
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.

View File

@@ -2,11 +2,19 @@
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
@@ -20,6 +28,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;
@@ -31,6 +43,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