2014-11-04 22:33:43 +01:00
=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeMembers.ts ===
//When used as a contextual type, a union type U has those members that are present in any of
// its constituent types, with types that are unions of the respective members in the constituent types.
interface I1<T> {
2015-04-16 01:44:20 +02:00
>I1 : I1<T>
>T : T
2014-11-04 22:33:43 +01:00
commonMethodType(a: string): string;
2015-04-16 01:44:20 +02:00
>commonMethodType : (a: string) => string
>a : string
2014-11-04 22:33:43 +01:00
commonPropertyType: string;
2015-04-16 01:44:20 +02:00
>commonPropertyType : string
2014-11-04 22:33:43 +01:00
commonMethodWithTypeParameter(a: T): T;
2015-04-16 01:44:20 +02:00
>commonMethodWithTypeParameter : (a: T) => T
>a : T
>T : T
>T : T
2014-11-04 22:33:43 +01:00
methodOnlyInI1(a: string): string;
2015-04-16 01:44:20 +02:00
>methodOnlyInI1 : (a: string) => string
>a : string
2014-11-04 22:33:43 +01:00
propertyOnlyInI1: string;
2015-04-16 01:44:20 +02:00
>propertyOnlyInI1 : string
2014-11-04 22:33:43 +01:00
}
interface I2<T> {
2015-04-16 01:44:20 +02:00
>I2 : I2<T>
>T : T
2014-11-04 22:33:43 +01:00
commonMethodType(a: string): string;
2015-04-16 01:44:20 +02:00
>commonMethodType : (a: string) => string
>a : string
2014-11-04 22:33:43 +01:00
commonPropertyType: string;
2015-04-16 01:44:20 +02:00
>commonPropertyType : string
2014-11-04 22:33:43 +01:00
commonMethodWithTypeParameter(a: T): T;
2015-04-16 01:44:20 +02:00
>commonMethodWithTypeParameter : (a: T) => T
>a : T
>T : T
>T : T
2014-11-04 22:33:43 +01:00
methodOnlyInI2(a: string): string;
2015-04-16 01:44:20 +02:00
>methodOnlyInI2 : (a: string) => string
>a : string
2014-11-04 22:33:43 +01:00
propertyOnlyInI2: string;
2015-04-16 01:44:20 +02:00
>propertyOnlyInI2 : string
2014-11-04 22:33:43 +01:00
}
// Let S be the set of types in U that has a property P.
// If S is not empty, U has a property P of a union type of the types of P from each type in S.
var i1: I1<number>;
2015-04-16 01:44:20 +02:00
>i1 : I1<number>
>I1 : I1<T>
2014-11-04 22:33:43 +01:00
var i2: I2<number>;
2015-04-16 01:44:20 +02:00
>i2 : I2<number>
>I2 : I2<T>
2014-11-04 22:33:43 +01:00
var i1Ori2: I1<number> | I2<number> = i1;
2015-04-16 01:44:20 +02:00
>i1Ori2 : I1<number> | I2<number>
>I1 : I1<T>
>I2 : I2<T>
>i1 : I1<number>
2014-11-04 22:33:43 +01:00
var i1Ori2: I1<number> | I2<number> = i2;
2015-04-16 01:44:20 +02:00
>i1Ori2 : I1<number> | I2<number>
>I1 : I1<T>
>I2 : I2<T>
>i2 : I2<number>
2014-11-04 22:33:43 +01:00
var i1Ori2: I1<number> | I2<number> = { // Like i1
2015-04-16 01:44:20 +02:00
>i1Ori2 : I1<number> | I2<number>
>I1 : I1<T>
>I2 : I2<T>
2014-11-04 22:33:43 +01:00
>{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; }
commonPropertyType: "hello",
2015-04-16 01:44:20 +02:00
>commonPropertyType : string
2015-04-13 21:36:11 +02:00
>"hello" : string
2014-11-04 22:33:43 +01:00
commonMethodType: a=> a,
2015-04-16 01:44:20 +02:00
>commonMethodType : (a: string) => string
2014-11-04 22:33:43 +01:00
>a=> a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
commonMethodWithTypeParameter: a => a,
2015-04-16 01:44:20 +02:00
>commonMethodWithTypeParameter : (a: number) => number
2014-11-04 22:33:43 +01:00
>a => a : (a: number) => number
2015-04-16 01:44:20 +02:00
>a : number
>a : number
2014-11-04 22:33:43 +01:00
methodOnlyInI1: a => a,
2015-04-16 01:44:20 +02:00
>methodOnlyInI1 : (a: string) => string
2014-11-04 22:33:43 +01:00
>a => a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
propertyOnlyInI1: "Hello",
2015-04-16 01:44:20 +02:00
>propertyOnlyInI1 : string
2015-04-13 21:36:11 +02:00
>"Hello" : string
2014-11-04 22:33:43 +01:00
};
var i1Ori2: I1<number> | I2<number> = { // Like i2
2015-04-16 01:44:20 +02:00
>i1Ori2 : I1<number> | I2<number>
>I1 : I1<T>
>I2 : I2<T>
2014-11-04 22:33:43 +01:00
>{ // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; }
commonPropertyType: "hello",
2015-04-16 01:44:20 +02:00
>commonPropertyType : string
2015-04-13 21:36:11 +02:00
>"hello" : string
2014-11-04 22:33:43 +01:00
commonMethodType: a=> a,
2015-04-16 01:44:20 +02:00
>commonMethodType : (a: string) => string
2014-11-04 22:33:43 +01:00
>a=> a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
commonMethodWithTypeParameter: a => a,
2015-04-16 01:44:20 +02:00
>commonMethodWithTypeParameter : (a: number) => number
2014-11-04 22:33:43 +01:00
>a => a : (a: number) => number
2015-04-16 01:44:20 +02:00
>a : number
>a : number
2014-11-04 22:33:43 +01:00
methodOnlyInI2: a => a,
2015-04-16 01:44:20 +02:00
>methodOnlyInI2 : (a: string) => string
2014-11-04 22:33:43 +01:00
>a => a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
propertyOnlyInI2: "Hello",
2015-04-16 01:44:20 +02:00
>propertyOnlyInI2 : string
2015-04-13 21:36:11 +02:00
>"Hello" : string
2014-11-04 22:33:43 +01:00
};
var i1Ori2: I1<number> | I2<number> = { // Like i1 and i2 both
2015-04-16 01:44:20 +02:00
>i1Ori2 : I1<number> | I2<number>
>I1 : I1<T>
>I2 : I2<T>
2014-11-04 22:33:43 +01:00
>{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; }
commonPropertyType: "hello",
2015-04-16 01:44:20 +02:00
>commonPropertyType : string
2015-04-13 21:36:11 +02:00
>"hello" : string
2014-11-04 22:33:43 +01:00
commonMethodType: a=> a,
2015-04-16 01:44:20 +02:00
>commonMethodType : (a: string) => string
2014-11-04 22:33:43 +01:00
>a=> a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
commonMethodWithTypeParameter: a => a,
2015-04-16 01:44:20 +02:00
>commonMethodWithTypeParameter : (a: number) => number
2014-11-04 22:33:43 +01:00
>a => a : (a: number) => number
2015-04-16 01:44:20 +02:00
>a : number
>a : number
2014-11-04 22:33:43 +01:00
methodOnlyInI1: a => a,
2015-04-16 01:44:20 +02:00
>methodOnlyInI1 : (a: string) => string
2014-11-04 22:33:43 +01:00
>a => a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
propertyOnlyInI1: "Hello",
2015-04-16 01:44:20 +02:00
>propertyOnlyInI1 : string
2015-04-13 21:36:11 +02:00
>"Hello" : string
2014-11-04 22:33:43 +01:00
methodOnlyInI2: a => a,
2015-04-16 01:44:20 +02:00
>methodOnlyInI2 : (a: string) => string
2014-11-04 22:33:43 +01:00
>a => a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
propertyOnlyInI2: "Hello",
2015-04-16 01:44:20 +02:00
>propertyOnlyInI2 : string
2015-04-13 21:36:11 +02:00
>"Hello" : string
2014-11-04 22:33:43 +01:00
};
var arrayI1OrI2: Array<I1<number> | I2<number>> = [i1, i2, { // Like i1
2015-04-16 01:44:20 +02:00
>arrayI1OrI2 : (I1<number> | I2<number>)[]
>Array : T[]
>I1 : I1<T>
>I2 : I2<T>
2015-07-16 06:14:04 +02:00
>[i1, i2, { // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", }, { // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }, { // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }] : (I1<number> | I2<number> | { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; })[]
2015-04-16 01:44:20 +02:00
>i1 : I1<number>
>i2 : I2<number>
2014-11-04 22:33:43 +01:00
>{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; }
commonPropertyType: "hello",
2015-04-16 01:44:20 +02:00
>commonPropertyType : string
2015-04-13 21:36:11 +02:00
>"hello" : string
2014-11-04 22:33:43 +01:00
commonMethodType: a=> a,
2015-04-16 01:44:20 +02:00
>commonMethodType : (a: string) => string
2014-11-04 22:33:43 +01:00
>a=> a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
commonMethodWithTypeParameter: a => a,
2015-04-16 01:44:20 +02:00
>commonMethodWithTypeParameter : (a: number) => number
2014-11-04 22:33:43 +01:00
>a => a : (a: number) => number
2015-04-16 01:44:20 +02:00
>a : number
>a : number
2014-11-04 22:33:43 +01:00
methodOnlyInI1: a => a,
2015-04-16 01:44:20 +02:00
>methodOnlyInI1 : (a: string) => string
2014-11-04 22:33:43 +01:00
>a => a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
propertyOnlyInI1: "Hello",
2015-04-16 01:44:20 +02:00
>propertyOnlyInI1 : string
2015-04-13 21:36:11 +02:00
>"Hello" : string
2014-11-04 22:33:43 +01:00
},
{ // Like i2
>{ // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; }
commonPropertyType: "hello",
2015-04-16 01:44:20 +02:00
>commonPropertyType : string
2015-04-13 21:36:11 +02:00
>"hello" : string
2014-11-04 22:33:43 +01:00
commonMethodType: a=> a,
2015-04-16 01:44:20 +02:00
>commonMethodType : (a: string) => string
2014-11-04 22:33:43 +01:00
>a=> a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
commonMethodWithTypeParameter: a => a,
2015-04-16 01:44:20 +02:00
>commonMethodWithTypeParameter : (a: number) => number
2014-11-04 22:33:43 +01:00
>a => a : (a: number) => number
2015-04-16 01:44:20 +02:00
>a : number
>a : number
2014-11-04 22:33:43 +01:00
methodOnlyInI2: a => a,
2015-04-16 01:44:20 +02:00
>methodOnlyInI2 : (a: string) => string
2014-11-04 22:33:43 +01:00
>a => a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
propertyOnlyInI2: "Hello",
2015-04-16 01:44:20 +02:00
>propertyOnlyInI2 : string
2015-04-13 21:36:11 +02:00
>"Hello" : string
2014-11-04 22:33:43 +01:00
}, { // Like i1 and i2 both
>{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; }
commonPropertyType: "hello",
2015-04-16 01:44:20 +02:00
>commonPropertyType : string
2015-04-13 21:36:11 +02:00
>"hello" : string
2014-11-04 22:33:43 +01:00
commonMethodType: a=> a,
2015-04-16 01:44:20 +02:00
>commonMethodType : (a: string) => string
2014-11-04 22:33:43 +01:00
>a=> a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
commonMethodWithTypeParameter: a => a,
2015-04-16 01:44:20 +02:00
>commonMethodWithTypeParameter : (a: number) => number
2014-11-04 22:33:43 +01:00
>a => a : (a: number) => number
2015-04-16 01:44:20 +02:00
>a : number
>a : number
2014-11-04 22:33:43 +01:00
methodOnlyInI1: a => a,
2015-04-16 01:44:20 +02:00
>methodOnlyInI1 : (a: string) => string
2014-11-04 22:33:43 +01:00
>a => a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
propertyOnlyInI1: "Hello",
2015-04-16 01:44:20 +02:00
>propertyOnlyInI1 : string
2015-04-13 21:36:11 +02:00
>"Hello" : string
2014-11-04 22:33:43 +01:00
methodOnlyInI2: a => a,
2015-04-16 01:44:20 +02:00
>methodOnlyInI2 : (a: string) => string
2014-11-04 22:33:43 +01:00
>a => a : (a: string) => string
2015-04-16 01:44:20 +02:00
>a : string
>a : string
2014-11-04 22:33:43 +01:00
propertyOnlyInI2: "Hello",
2015-04-16 01:44:20 +02:00
>propertyOnlyInI2 : string
2015-04-13 21:36:11 +02:00
>"Hello" : string
2014-11-04 22:33:43 +01:00
}];
interface I11 {
2015-04-16 01:44:20 +02:00
>I11 : I11
2014-11-04 22:33:43 +01:00
commonMethodDifferentReturnType(a: string, b: number): string;
2015-04-16 01:44:20 +02:00
>commonMethodDifferentReturnType : (a: string, b: number) => string
>a : string
>b : number
2014-11-04 22:33:43 +01:00
commonPropertyDifferentType: string;
2015-04-16 01:44:20 +02:00
>commonPropertyDifferentType : string
2014-11-04 22:33:43 +01:00
}
interface I21 {
2015-04-16 01:44:20 +02:00
>I21 : I21
2014-11-04 22:33:43 +01:00
commonMethodDifferentReturnType(a: string, b: number): number;
2015-04-16 01:44:20 +02:00
>commonMethodDifferentReturnType : (a: string, b: number) => number
>a : string
>b : number
2014-11-04 22:33:43 +01:00
commonPropertyDifferentType: number;
2015-04-16 01:44:20 +02:00
>commonPropertyDifferentType : number
2014-11-04 22:33:43 +01:00
}
var i11: I11;
2015-04-16 01:44:20 +02:00
>i11 : I11
>I11 : I11
2014-11-04 22:33:43 +01:00
var i21: I21;
2015-04-16 01:44:20 +02:00
>i21 : I21
>I21 : I21
2014-11-04 22:33:43 +01:00
var i11Ori21: I11 | I21 = i11;
2015-04-16 01:44:20 +02:00
>i11Ori21 : I11 | I21
>I11 : I11
>I21 : I21
>i11 : I11
2014-11-04 22:33:43 +01:00
var i11Ori21: I11 | I21 = i21;
2015-04-16 01:44:20 +02:00
>i11Ori21 : I11 | I21
>I11 : I11
>I21 : I21
>i21 : I21
2014-11-04 22:33:43 +01:00
var i11Ori21: I11 | I21 = {
2015-04-16 01:44:20 +02:00
>i11Ori21 : I11 | I21
>I11 : I11
>I21 : I21
2014-11-04 23:49:15 +01:00
>{ // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", } : { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: string; }
2014-11-04 22:33:43 +01:00
// Like i1
commonMethodDifferentReturnType: (a, b) => {
2015-04-16 01:44:20 +02:00
>commonMethodDifferentReturnType : (a: string, b: number) => string
2014-11-04 23:49:15 +01:00
>(a, b) => { var z = a.charAt(b); return z; } : (a: string, b: number) => string
2015-04-16 01:44:20 +02:00
>a : string
>b : number
2014-11-04 22:33:43 +01:00
var z = a.charAt(b);
2015-04-16 01:44:20 +02:00
>z : string
2014-11-04 23:49:15 +01:00
>a.charAt(b) : string
2015-04-16 01:44:20 +02:00
>a.charAt : (pos: number) => string
>a : string
>charAt : (pos: number) => string
>b : number
2014-11-04 22:33:43 +01:00
return z;
2015-04-16 01:44:20 +02:00
>z : string
2014-11-04 22:33:43 +01:00
},
commonPropertyDifferentType: "hello",
2015-04-16 01:44:20 +02:00
>commonPropertyDifferentType : string
2015-04-13 21:36:11 +02:00
>"hello" : string
2014-11-04 22:33:43 +01:00
};
var i11Ori21: I11 | I21 = {
2015-04-16 01:44:20 +02:00
>i11Ori21 : I11 | I21
>I11 : I11
>I21 : I21
2014-11-04 23:49:15 +01:00
>{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10,} : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; }
2014-11-04 22:33:43 +01:00
// Like i2
commonMethodDifferentReturnType: (a, b) => {
2015-04-16 01:44:20 +02:00
>commonMethodDifferentReturnType : (a: string, b: number) => number
2014-11-04 23:49:15 +01:00
>(a, b) => { var z = a.charCodeAt(b); return z; } : (a: string, b: number) => number
2015-04-16 01:44:20 +02:00
>a : string
>b : number
2014-11-04 22:33:43 +01:00
var z = a.charCodeAt(b);
2015-04-16 01:44:20 +02:00
>z : number
2014-11-04 23:49:15 +01:00
>a.charCodeAt(b) : number
2015-04-16 01:44:20 +02:00
>a.charCodeAt : (index: number) => number
>a : string
>charCodeAt : (index: number) => number
>b : number
2014-11-04 22:33:43 +01:00
return z;
2015-04-16 01:44:20 +02:00
>z : number
2014-11-04 22:33:43 +01:00
},
commonPropertyDifferentType: 10,
2015-04-16 01:44:20 +02:00
>commonPropertyDifferentType : number
2015-04-13 21:36:11 +02:00
>10 : number
2014-11-04 22:33:43 +01:00
};
var arrayOrI11OrI21: Array<I11 | I21> = [i11, i21, i11 || i21, {
2015-04-16 01:44:20 +02:00
>arrayOrI11OrI21 : (I11 | I21)[]
>Array : T[]
>I11 : I11
>I21 : I21
2014-11-04 23:49:15 +01:00
>[i11, i21, i11 || i21, { // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", }, { // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, }] : (I11 | I21)[]
2015-04-16 01:44:20 +02:00
>i11 : I11
>i21 : I21
2014-11-04 22:33:43 +01:00
>i11 || i21 : I11 | I21
2015-04-16 01:44:20 +02:00
>i11 : I11
>i21 : I21
2014-11-04 23:49:15 +01:00
>{ // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", } : { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: string; }
2014-11-04 22:33:43 +01:00
// Like i1
commonMethodDifferentReturnType: (a, b) => {
2015-04-16 01:44:20 +02:00
>commonMethodDifferentReturnType : (a: string, b: number) => string
2014-11-04 23:49:15 +01:00
>(a, b) => { var z = a.charAt(b); return z; } : (a: string, b: number) => string
2015-04-16 01:44:20 +02:00
>a : string
>b : number
2014-11-04 22:33:43 +01:00
var z = a.charAt(b);
2015-04-16 01:44:20 +02:00
>z : string
2014-11-04 23:49:15 +01:00
>a.charAt(b) : string
2015-04-16 01:44:20 +02:00
>a.charAt : (pos: number) => string
>a : string
>charAt : (pos: number) => string
>b : number
2014-11-04 22:33:43 +01:00
return z;
2015-04-16 01:44:20 +02:00
>z : string
2014-11-04 22:33:43 +01:00
},
commonPropertyDifferentType: "hello",
2015-04-16 01:44:20 +02:00
>commonPropertyDifferentType : string
2015-04-13 21:36:11 +02:00
>"hello" : string
2014-11-04 22:33:43 +01:00
}, {
2014-11-04 23:49:15 +01:00
>{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, } : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; }
2014-11-04 22:33:43 +01:00
// Like i2
commonMethodDifferentReturnType: (a, b) => {
2015-04-16 01:44:20 +02:00
>commonMethodDifferentReturnType : (a: string, b: number) => number
2014-11-04 23:49:15 +01:00
>(a, b) => { var z = a.charCodeAt(b); return z; } : (a: string, b: number) => number
2015-04-16 01:44:20 +02:00
>a : string
>b : number
2014-11-04 22:33:43 +01:00
var z = a.charCodeAt(b);
2015-04-16 01:44:20 +02:00
>z : number
2014-11-04 23:49:15 +01:00
>a.charCodeAt(b) : number
2015-04-16 01:44:20 +02:00
>a.charCodeAt : (index: number) => number
>a : string
>charCodeAt : (index: number) => number
>b : number
2014-11-04 22:33:43 +01:00
return z;
2015-04-16 01:44:20 +02:00
>z : number
2014-11-04 22:33:43 +01:00
},
commonPropertyDifferentType: 10,
2015-04-16 01:44:20 +02:00
>commonPropertyDifferentType : number
2015-04-13 21:36:11 +02:00
>10 : number
2014-11-04 22:33:43 +01:00
}];