83 lines
2.3 KiB
Text
83 lines
2.3 KiB
Text
|
=== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunction.ts ===
|
||
|
// object types with call signatures can override members of Function
|
||
|
// no errors expected below
|
||
|
|
||
|
interface I {
|
||
|
>I : I
|
||
|
|
||
|
(): void;
|
||
|
apply(a: any, b?: any): void;
|
||
|
>apply : (a: any, b?: any) => void
|
||
|
>a : any
|
||
|
>b : any
|
||
|
|
||
|
call(thisArg: number, ...argArray: number[]): any;
|
||
|
>call : (thisArg: number, ...argArray: number[]) => any
|
||
|
>thisArg : number
|
||
|
>argArray : number[]
|
||
|
}
|
||
|
|
||
|
var i: I;
|
||
|
>i : I
|
||
|
>I : I
|
||
|
|
||
|
var r1: (a: any, b?: any) => void = i.apply;
|
||
|
>r1 : (a: any, b?: any) => void
|
||
|
>a : any
|
||
|
>b : any
|
||
|
>i.apply : (a: any, b?: any) => void
|
||
|
>i : I
|
||
|
>apply : (a: any, b?: any) => void
|
||
|
|
||
|
var r1b: (thisArg: number, ...argArray: number[]) => void = i.call;
|
||
|
>r1b : (thisArg: number, ...argArray: number[]) => void
|
||
|
>thisArg : number
|
||
|
>argArray : number[]
|
||
|
>i.call : (thisArg: number, ...argArray: number[]) => any
|
||
|
>i : I
|
||
|
>call : (thisArg: number, ...argArray: number[]) => any
|
||
|
|
||
|
var r1c = i.arguments;
|
||
|
>r1c : any
|
||
|
>i.arguments : any
|
||
|
>i : I
|
||
|
>arguments : any
|
||
|
|
||
|
var x: {
|
||
|
>x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; }
|
||
|
|
||
|
(): void;
|
||
|
apply(a: any, b?: any): void;
|
||
|
>apply : (a: any, b?: any) => void
|
||
|
>a : any
|
||
|
>b : any
|
||
|
|
||
|
call(thisArg: number, ...argArray: number[]): any;
|
||
|
>call : (thisArg: number, ...argArray: number[]) => any
|
||
|
>thisArg : number
|
||
|
>argArray : number[]
|
||
|
}
|
||
|
|
||
|
var r2: (a: any, b?: any) => void = x.apply;
|
||
|
>r2 : (a: any, b?: any) => void
|
||
|
>a : any
|
||
|
>b : any
|
||
|
>x.apply : (a: any, b?: any) => void
|
||
|
>x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; }
|
||
|
>apply : (a: any, b?: any) => void
|
||
|
|
||
|
var r2b: (thisArg: number, ...argArray: number[]) => void = x.call;
|
||
|
>r2b : (thisArg: number, ...argArray: number[]) => void
|
||
|
>thisArg : number
|
||
|
>argArray : number[]
|
||
|
>x.call : (thisArg: number, ...argArray: number[]) => any
|
||
|
>x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; }
|
||
|
>call : (thisArg: number, ...argArray: number[]) => any
|
||
|
|
||
|
var r2c = x.arguments;
|
||
|
>r2c : any
|
||
|
>x.arguments : any
|
||
|
>x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; }
|
||
|
>arguments : any
|
||
|
|