2015-02-03 02:36:45 +01:00
|
|
|
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES6.ts ===
|
2015-01-22 02:01:42 +01:00
|
|
|
declare function extractIndexer<T>(p: { [n: number]: T }): T;
|
2015-04-13 23:01:57 +02:00
|
|
|
>extractIndexer : <T>(p: { [n: number]: T; }) => T, Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0))
|
|
|
|
>T : T, Symbol(T, Decl(computedPropertyNames48_ES6.ts, 0, 32))
|
|
|
|
>p : { [n: number]: T; }, Symbol(p, Decl(computedPropertyNames48_ES6.ts, 0, 35))
|
|
|
|
>n : number, Symbol(n, Decl(computedPropertyNames48_ES6.ts, 0, 41))
|
|
|
|
>T : T, Symbol(T, Decl(computedPropertyNames48_ES6.ts, 0, 32))
|
|
|
|
>T : T, Symbol(T, Decl(computedPropertyNames48_ES6.ts, 0, 32))
|
2015-01-22 02:01:42 +01:00
|
|
|
|
|
|
|
enum E { x }
|
2015-04-13 23:01:57 +02:00
|
|
|
>E : E, Symbol(E, Decl(computedPropertyNames48_ES6.ts, 0, 61))
|
|
|
|
>x : E, Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8))
|
2015-01-22 02:01:42 +01:00
|
|
|
|
|
|
|
var a: any;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : any, Symbol(a, Decl(computedPropertyNames48_ES6.ts, 4, 3))
|
2015-01-22 02:01:42 +01:00
|
|
|
|
|
|
|
extractIndexer({
|
|
|
|
>extractIndexer({ [a]: ""}) : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>extractIndexer : <T>(p: { [n: number]: T; }) => T, Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0))
|
2015-01-22 02:01:42 +01:00
|
|
|
>{ [a]: ""} : { [x: number]: string; }
|
|
|
|
|
|
|
|
[a]: ""
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : any, Symbol(a, Decl(computedPropertyNames48_ES6.ts, 4, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2015-01-22 02:01:42 +01:00
|
|
|
|
|
|
|
}); // Should return string
|
|
|
|
|
|
|
|
extractIndexer({
|
|
|
|
>extractIndexer({ [E.x]: ""}) : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>extractIndexer : <T>(p: { [n: number]: T; }) => T, Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0))
|
2015-01-22 02:01:42 +01:00
|
|
|
>{ [E.x]: ""} : { [x: number]: string; }
|
|
|
|
|
|
|
|
[E.x]: ""
|
2015-04-13 23:01:57 +02:00
|
|
|
>E.x : E, Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8))
|
|
|
|
>E : typeof E, Symbol(E, Decl(computedPropertyNames48_ES6.ts, 0, 61))
|
|
|
|
>x : E, Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2015-01-22 02:01:42 +01:00
|
|
|
|
|
|
|
}); // Should return string
|
|
|
|
|
|
|
|
extractIndexer({
|
|
|
|
>extractIndexer({ ["" || 0]: ""}) : any
|
2015-04-13 23:01:57 +02:00
|
|
|
>extractIndexer : <T>(p: { [n: number]: T; }) => T, Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0))
|
2015-01-22 02:01:42 +01:00
|
|
|
>{ ["" || 0]: ""} : { [x: number]: undefined; }
|
|
|
|
|
|
|
|
["" || 0]: ""
|
|
|
|
>"" || 0 : string | number
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
|
|
|
>0 : number
|
|
|
|
>"" : string
|
2015-01-22 02:01:42 +01:00
|
|
|
|
|
|
|
}); // Should return any (widened form of undefined)
|