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;
|
|
|
|
>extractIndexer : <T>(p: { [n: number]: T; }) => T
|
|
|
|
>T : T
|
|
|
|
>p : { [n: number]: T; }
|
|
|
|
>n : number
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
enum E { x }
|
|
|
|
>E : E
|
|
|
|
>x : E
|
|
|
|
|
|
|
|
var a: any;
|
|
|
|
>a : any
|
|
|
|
|
|
|
|
extractIndexer({
|
|
|
|
>extractIndexer({ [a]: ""}) : string
|
|
|
|
>extractIndexer : <T>(p: { [n: number]: T; }) => T
|
|
|
|
>{ [a]: ""} : { [x: number]: string; }
|
|
|
|
|
|
|
|
[a]: ""
|
|
|
|
>a : any
|
|
|
|
|
|
|
|
}); // Should return string
|
|
|
|
|
|
|
|
extractIndexer({
|
|
|
|
>extractIndexer({ [E.x]: ""}) : string
|
|
|
|
>extractIndexer : <T>(p: { [n: number]: T; }) => T
|
|
|
|
>{ [E.x]: ""} : { [x: number]: string; }
|
|
|
|
|
|
|
|
[E.x]: ""
|
|
|
|
>E.x : E
|
|
|
|
>E : typeof E
|
|
|
|
>x : E
|
|
|
|
|
|
|
|
}); // Should return string
|
|
|
|
|
|
|
|
extractIndexer({
|
|
|
|
>extractIndexer({ ["" || 0]: ""}) : any
|
|
|
|
>extractIndexer : <T>(p: { [n: number]: T; }) => T
|
|
|
|
>{ ["" || 0]: ""} : { [x: number]: undefined; }
|
|
|
|
|
|
|
|
["" || 0]: ""
|
|
|
|
>"" || 0 : string | number
|
|
|
|
|
|
|
|
}); // Should return any (widened form of undefined)
|